From 8d38dfabb114d8a93c34ce1258d97e389f5645d9 Mon Sep 17 00:00:00 2001 From: horchi Date: Mon, 27 Jul 2020 15:44:12 +0200 Subject: 2020-07-27: version 1.1.161 (Alexander Grothe, horchi)\n - change: Porting to new libmicrohttpd\n\n --- HISTORY.h | 5 ++++- httpd.c | 14 +++++++------- httpd.h | 14 +++++++++----- webauth.c | 4 ++-- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/HISTORY.h b/HISTORY.h index 612fc51..b1d41ec 100644 --- a/HISTORY.h +++ b/HISTORY.h @@ -4,7 +4,7 @@ * ----------------------------------- */ -#define _VERSION "1.1.160" +#define _VERSION "1.1.161" #define VERSION_DATE "27.07.2020" #define DB_API 7 @@ -19,6 +19,9 @@ * * +2020-07-27: version 1.1.161 (Alexander Grothe, horchi) + - change: Porting to new libmicrohttpd + 2020-07-27: version 1.1.160 (horchi) - change: Minor change of README diff --git a/httpd.c b/httpd.c index d8e8687..c0eefea 100644 --- a/httpd.c +++ b/httpd.c @@ -1712,7 +1712,7 @@ int cEpgHttpd::performPostData(const char* url, MemoryStruct* data) // Debug ... //*************************************************************************** -int debugPrint(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) +MHD_Result debugPrint(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) { if (kind == MHD_GET_ARGUMENT_KIND) tell(0, "Parameter: '%s' - '%s'", key, value); @@ -1722,7 +1722,7 @@ int debugPrint(void *cls, enum MHD_ValueKind kind, const char *key, const char * return MHD_YES; } -int parameterInfo(void* cls, enum MHD_ValueKind kind, const char* key, const char* value) +MHD_Result parameterInfo(void* cls, enum MHD_ValueKind kind, const char* key, const char* value) { if (strlen((char*)cls) < 1000 - strlen(notNull(value)) - strlen(notNull(key)) - 10) sprintf(eos((char*)cls), "%s:%s;", notNull(key), notNull(value)); @@ -1734,10 +1734,10 @@ int parameterInfo(void* cls, enum MHD_ValueKind kind, const char* key, const cha // Dispatcher //*************************************************************************** -int cEpgHttpd::dispatcher(void* cls, MHD_Connection* tcp, - const char* url, const char* method, - const char* version, const char* upload_data, - size_t* upload_data_size, void** con_cls) +MHD_Result cEpgHttpd::dispatcher(void* cls, MHD_Connection* tcp, + const char* url, const char* method, + const char* version, const char* upload_data, + size_t* upload_data_size, void** con_cls) { const char* contentNotFound = "Page not found"; unsigned int statusCode = MHD_HTTP_OK; @@ -1746,7 +1746,7 @@ int cEpgHttpd::dispatcher(void* cls, MHD_Connection* tcp, double requestStartAt = cMyTimeMs::Now(); // int acceptRequest = no; - int state; + MHD_Result state; // reset session diff --git a/httpd.h b/httpd.h index c5fb94e..bbaa2f5 100644 --- a/httpd.h +++ b/httpd.h @@ -16,6 +16,10 @@ #include +#if MHD_VERSION < 0x00097002 +# define MHD_Result int +#endif + #include "lib/epgservice.h" #include "lib/json.h" #include "lib/configuration.h" @@ -198,12 +202,12 @@ class cEpgHttpd : public cFrame, public cWebTools, public cSystemNotification // static - static int dispatcher(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); + static MHD_Result dispatcher(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); - static int askForAuthentication(struct MHD_Connection* connection, const char* realm); + static MHD_Result askForAuthentication(struct MHD_Connection* connection, const char* realm); static int isAuthenticated(struct MHD_Connection* connection, const char* username, const char* password); diff --git a/webauth.c b/webauth.c index 30f78af..66fbf3c 100644 --- a/webauth.c +++ b/webauth.c @@ -54,9 +54,9 @@ char* string2base64(const char* message) // Ask For Authentication //*************************************************************************** -int cEpgHttpd::askForAuthentication(struct MHD_Connection* connection, const char* realm) +MHD_Result cEpgHttpd::askForAuthentication(struct MHD_Connection* connection, const char* realm) { - int status; + MHD_Result status; struct MHD_Response* response; char* headervalue = 0; -- cgit v1.2.3