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

Fix build when using libmicrohttpd 0.9.75 #18

Open
sonicdebris opened this issue May 14, 2023 · 1 comment
Open

Fix build when using libmicrohttpd 0.9.75 #18

sonicdebris opened this issue May 14, 2023 · 1 comment

Comments

@sonicdebris
Copy link

Building on ubuntu 22.04 requires a trivial fix due to some changes in the libmicrohttpd version available for installation through apt-get.

It's about an int argument being replaced with an enum, the full diff of the changes that fix the issue is here:

@@ -103,7 +103,7 @@ static void endRequest (void *cls, struct MHD_Connection *connection, void **con
 
 
 // process rest API query
-STATIC int requestApi (struct MHD_Connection *connection, AJG_session *session, const char *method,  const char* url
+STATIC enum MHD_Result requestApi (struct MHD_Connection *connection, AJG_session *session, const char *method,  const char* url
                       , const char *upload_data, size_t *upload_data_size, void **con_cls) {
   const char  *query, *param;
   json_object *cmd;
@@ -333,7 +333,7 @@ STATIC void computeEtag (char *etag, int maxlen, struct stat *sbuf) {
 }
 
 // minimal httpd file server for static HTML,JS,CSS,etc...
-STATIC int requestFile (struct MHD_Connection *connection, AJG_session *session, const char* url) {
+STATIC enum MHD_Result requestFile (struct MHD_Connection *connection, AJG_session *session, const char* url) {
     int fd;
     int ret;
     struct stat sbuf;
@@ -414,7 +414,7 @@ STATIC int requestFile (struct MHD_Connection *connection, AJG_session *session,
     return ret;
 }
 
-STATIC int newRequest (void *cls,
+STATIC enum MHD_Result newRequest (void *cls,
   struct MHD_Connection *connection,
   const char *url,
   const char *method,
@@ -435,7 +435,7 @@ STATIC int newRequest (void *cls,
 }
 
 
-STATIC int newClient (void *cls, const struct sockaddr * addr, socklen_t addrlen) {
+STATIC enum MHD_Result newClient (void *cls, const struct sockaddr * addr, socklen_t addrlen) {
   // check if client is comming from an acceptable IP
   return (MHD_YES); // MHD_NO
 }
 
 // minimal httpd file server for static HTML,JS,CSS,etc...
-STATIC int requestFile (struct MHD_Connection *connection, AJG_session *session, const char* url) {
+STATIC enum MHD_Result requestFile (struct MHD_Connection *connection, AJG_session *session, const char* url) {

I could open a PR if the changes are ok.

@fulup-bzh
Copy link
Owner

Please send a PR and I will merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants