Permalink
Browse files

webserver: add logging of called URLs

  • Loading branch information...
Montellese committed May 12, 2012
1 parent c3c0d1c commit 3dbd0839e884c77ae1f14bf257cae3d13b7bf806
Showing with 9 additions and 0 deletions.
  1. +7 −0 xbmc/network/WebServer.cpp
  2. +2 −0 xbmc/network/WebServer.h
@@ -447,6 +447,12 @@ int CWebServer::SendErrorResponse(struct MHD_Connection *connection, int errorTy
return ret;
}
+void* CWebServer::UriRequestLogger(void *cls, const char *uri)
+{
+ CLog::Log(LOGDEBUG, "webserver: request received for %s", uri);
+ return NULL;
+}
+
#if (MHD_VERSION >= 0x00090200)
ssize_t CWebServer::ContentReaderCallback (void *cls, uint64_t pos, char *buf, size_t max)
#elif (MHD_VERSION >= 0x00040001)
@@ -492,6 +498,7 @@ struct MHD_Daemon* CWebServer::StartMHD(unsigned int flags, int port)
#endif
MHD_OPTION_CONNECTION_LIMIT, 512,
MHD_OPTION_CONNECTION_TIMEOUT, timeout,
+ MHD_OPTION_URI_LOG_CALLBACK, &CWebServer::UriRequestLogger, this,
MHD_OPTION_END);
}
View
@@ -60,6 +60,8 @@ class CWebServer : public JSONRPC::ITransportLayer
static int AskForAuthentication (struct MHD_Connection *connection);
static bool IsAuthenticated (CWebServer *server, struct MHD_Connection *connection);
+ static void* UriRequestLogger(void *cls, const char *uri);
+
#if (MHD_VERSION >= 0x00090200)
static ssize_t ContentReaderCallback (void *cls, uint64_t pos, char *buf, size_t max);
#elif (MHD_VERSION >= 0x00040001)

0 comments on commit 3dbd083

Please sign in to comment.