diff options
author | theuni <theuni@svn> | 2010-02-18 08:35:00 +0000 |
---|---|---|
committer | theuni <theuni@svn> | 2010-02-18 08:35:00 +0000 |
commit | 9f633beaa81cc24050cfddea752f52dc5bb57524 (patch) | |
tree | 663b6a0a1df85a85c3052a93ac7a60194599423e | |
parent | a6b40d96482ef176160dd8c8fe6dc3ec98ed5afe (diff) |
fixed: allow building with older versions of libmicrohttpd
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27939 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | README.ubuntu | 10 | ||||
-rw-r--r-- | xbmc/utils/WebServer.cpp | 11 | ||||
-rw-r--r-- | xbmc/utils/WebServer.h | 13 |
3 files changed, 20 insertions, 14 deletions
diff --git a/README.ubuntu b/README.ubuntu index ecdb18e5aa..1dbd151a25 100644 --- a/README.ubuntu +++ b/README.ubuntu @@ -67,16 +67,6 @@ already in the XBMC source code tree. # make # sudo make install -On 8.04 and older versions, libmicrohttpd is outdated and thus XBMC will not compile properly. -In this case you will have to manually compile the latest version. Luckly the source is -already in the XBMC source code tree. - # apt-get remove libmicrohttpd-dev - # sudo apt-get install texinfo - # cd lib/libmicrohttpd - # ./configure - # make - # sudo make install - -------------------------------------------------------------- 3.2. Use a single command to get all build dependencies -------------------------------------------------------------- diff --git a/xbmc/utils/WebServer.cpp b/xbmc/utils/WebServer.cpp index 37ef10768b..0a111cd634 100644 --- a/xbmc/utils/WebServer.cpp +++ b/xbmc/utils/WebServer.cpp @@ -90,10 +90,17 @@ bool CWebServer::IsAuthenticated (CWebServer *server, struct MHD_Connection *con return server->m_Credentials64Encoded.Equals(headervalue + strlen(strbase)); } +#if (MHD_VERSION >= 0x00040001) int CWebServer::AnswerToConnection(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) +#else +int CWebServer::AnswerToConnection(void *cls, struct MHD_Connection *connection, + const char *url, const char *method, + const char *version, const char *upload_data, + unsigned int *upload_data_size, void **con_cls) +#endif { CWebServer *server = (CWebServer *)cls; @@ -155,7 +162,11 @@ int CWebServer::AnswerToConnection(void *cls, struct MHD_Connection *connection, return MHD_NO; } +#if (MHD_VERSION >= 0x00040001) int CWebServer::JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, size_t *upload_data_size) +#else +int CWebServer::JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, unsigned int *upload_data_size) +#endif { #ifdef HAS_JSONRPC CStdString jsoncall; diff --git a/xbmc/utils/WebServer.h b/xbmc/utils/WebServer.h index edd3b46175..e5ef4854ab 100644 --- a/xbmc/utils/WebServer.h +++ b/xbmc/utils/WebServer.h @@ -56,18 +56,23 @@ public: private: static int AskForAuthentication (struct MHD_Connection *connection); static bool IsAuthenticated (CWebServer *server, struct MHD_Connection *connection); + +#if (MHD_VERSION >= 0x00040001) + static int ContentReaderCallback (void *cls, uint64_t pos, char *buf, int max); + static int JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, size_t *upload_data_size); static int AnswerToConnection (void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls); - -#if (MHD_VERSION >= 0x00040001) - static int ContentReaderCallback (void *cls, uint64_t pos, char *buf, int max); #else //libmicrohttpd < 0.4.0 static int ContentReaderCallback (void *cls, size_t pos, char *buf, int max); + static int JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, unsigned int *upload_data_size); + static int AnswerToConnection (void *cls, struct MHD_Connection *connection, + const char *url, const char *method, + const char *version, const char *upload_data, + unsigned int *upload_data_size, void **con_cls); #endif static void ContentReaderFreeCallback (void *cls); - static int JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, size_t *upload_data_size); static int HttpApi(struct MHD_Connection *connection); static int FillArgumentMap(void *cls, enum MHD_ValueKind kind, const char *key, const char *value); |