Skip to content

Commit

Permalink
webserver: add logging of called URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed May 12, 2012
1 parent c3c0d1c commit 3dbd083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xbmc/network/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions xbmc/network/WebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3dbd083

Please sign in to comment.