Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[local] use MHD_Result type with microhttpd >= 0.9.71, … #473

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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