@@ -952,7 +952,7 @@ int cWebem::CountSessions() {
952
952
}
953
953
954
954
void cWebem::CleanSessions () {
955
- #ifdef _DEBUG
955
+ #ifdef DEBUG_WWW
956
956
_log.Log (LOG_STATUS, " [web:%s] cleaning sessions..." , GetPort ().c_str ());
957
957
#endif
958
958
int before = CountSessions ();
@@ -1241,7 +1241,7 @@ std::string cWebemRequestHandler::generateSessionID()
1241
1241
1242
1242
std::string sessionId = GenerateMD5Hash (base64_encode ((const unsigned char *)randomValue.c_str (), randomValue.size ()));
1243
1243
1244
- #ifdef _DEBUG
1244
+ #ifdef DEBUG_WWW
1245
1245
_log.Log (LOG_STATUS, " [web:%s] generate new session id token %s" , myWebem->GetPort ().c_str (), sessionId.c_str ());
1246
1246
#endif
1247
1247
@@ -1261,7 +1261,7 @@ std::string cWebemRequestHandler::generateAuthToken(const WebEmSession & session
1261
1261
1262
1262
std::string authToken = base64_encode ((const unsigned char *)randomValue.c_str (), randomValue.size ());
1263
1263
1264
- #ifdef _DEBUG
1264
+ #ifdef DEBUG_WWW
1265
1265
_log.Log (LOG_STATUS, " [web:%s] generate new authentication token %s" , myWebem->GetPort ().c_str (), authToken.c_str ());
1266
1266
#endif
1267
1267
@@ -1508,8 +1508,8 @@ bool cWebemRequestHandler::checkAuthToken(WebEmSession & session) {
1508
1508
return false ;
1509
1509
}
1510
1510
1511
- #ifdef _DEBUG
1512
- // _log.Log(LOG_STATUS, "[web:%s] CheckAuthToken(%s_%s_%s) : user authenticated", myWebem->GetPort().c_str(), session.id.c_str(), session.auth_token.c_str(), session.username.c_str());
1511
+ #ifdef DEBUG_WWW
1512
+ _log.Log (LOG_STATUS, " [web:%s] CheckAuthToken(%s_%s_%s) : user authenticated" , myWebem->GetPort ().c_str (), session.id .c_str (), session.auth_token .c_str (), session.username .c_str ());
1513
1513
#endif
1514
1514
1515
1515
if (session.username .empty ()) {
@@ -1531,7 +1531,7 @@ bool cWebemRequestHandler::checkAuthToken(WebEmSession & session) {
1531
1531
sessionExpires = session.expires < now;
1532
1532
1533
1533
if (!userExists || sessionExpires) {
1534
- #ifdef _DEBUG
1534
+ #ifdef DEBUG_WWW
1535
1535
_log.Log (LOG_ERROR, " [web:%s] CheckAuthToken(%s_%s) : cannot restore session, user not found or session expired" , myWebem->GetPort ().c_str (), session.id .c_str (), session.auth_token .c_str ());
1536
1536
#endif
1537
1537
removeAuthToken (session.id );
@@ -1540,7 +1540,7 @@ bool cWebemRequestHandler::checkAuthToken(WebEmSession & session) {
1540
1540
1541
1541
WebEmSession* oldSession = myWebem->GetSession (session.id );
1542
1542
if (oldSession == NULL ) {
1543
- #ifdef _DEBUG
1543
+ #ifdef DEBUG_WWW
1544
1544
_log.Log (LOG_STATUS, " [web:%s] CheckAuthToken(%s_%s_%s) : restore session" , myWebem->GetPort ().c_str (), session.id .c_str (), session.auth_token .c_str (), session.username .c_str ());
1545
1545
#endif
1546
1546
myWebem->AddSession (session);
@@ -1633,7 +1633,7 @@ void cWebemRequestHandler::handle_request(const request& req, reply& rep)
1633
1633
// Find and include any special cWebem strings
1634
1634
if (!myWebem->Include (rep.content )) {
1635
1635
if (mInfo .mtime_support && !mInfo .is_modified ) {
1636
- #ifdef _DEBUG
1636
+ #ifdef DEBUG_WWW
1637
1637
_log.Log (LOG_STATUS, " [web:%s] %s not modified (1)." , myWebem->GetPort ().c_str (), req.uri .c_str ());
1638
1638
#endif
1639
1639
rep = reply::stock_reply (reply::not_modified);
@@ -1658,7 +1658,7 @@ void cWebemRequestHandler::handle_request(const request& req, reply& rep)
1658
1658
{
1659
1659
if (mInfo .mtime_support && !mInfo .is_modified ) {
1660
1660
rep = reply::stock_reply (reply::not_modified);
1661
- #ifdef _DEBUG
1661
+ #ifdef DEBUG_WWW
1662
1662
_log.Log (LOG_STATUS, " [web:%s] %s not modified (2)." , myWebem->GetPort ().c_str (), req.uri .c_str ());
1663
1663
#endif
1664
1664
return ;
@@ -1670,7 +1670,7 @@ void cWebemRequestHandler::handle_request(const request& req, reply& rep)
1670
1670
else {
1671
1671
if (mInfo .mtime_support && !mInfo .is_modified ) {
1672
1672
rep = reply::stock_reply (reply::not_modified);
1673
- #ifdef _DEBUG
1673
+ #ifdef DEBUG_WWW
1674
1674
_log.Log (LOG_STATUS, " [web:%s] %s not modified (3)." , myWebem->GetPort ().c_str (), req.uri .c_str ());
1675
1675
#endif
1676
1676
return ;
@@ -1701,7 +1701,9 @@ void cWebemRequestHandler::handle_request(const request& req, reply& rep)
1701
1701
send_cookie (rep, session);
1702
1702
1703
1703
} else if (session.forcelogin == true ) {
1704
+ #ifdef DEBUG_WWW
1704
1705
_log.Log (LOG_STATUS, " [web:%s] Logout : remove session %s" , myWebem->GetPort ().c_str (), session.id .c_str ());
1706
+ #endif
1705
1707
myWebem->RemoveSession (session.id );
1706
1708
removeAuthToken (session.id );
1707
1709
if (myWebem->m_authmethod == AUTH_BASIC) {
0 commit comments