Skip to content

Commit

Permalink
[local] use MHD_Result type with microhttpd >= 0.9.71,
Browse files Browse the repository at this point in the history
  • Loading branch information
r00t- committed Mar 30, 2021
1 parent fddf479 commit d4a0c9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions include/local.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@

#include <microhttpd.h>

int handle_request(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 >= 0x00097002
using MHD_RESULT = MHD_Result;
#else
using MHD_RESULT = int;
#endif

MHD_RESULT handle_request(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);

class Channel;
void shrink_localbuffer(); // remove old data in the local buffer
Expand Down
8 changes: 4 additions & 4 deletions src/local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ json_object *api_json_tuples(const char *uuid) {
return json_tuples;
}

int handle_request(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) {
MHD_RESULT handle_request(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) {

int status;
MHD_RESULT status;
int response_code = MHD_HTTP_NOT_FOUND;

// mapping between meters and channels
Expand Down

0 comments on commit d4a0c9b

Please sign in to comment.