Originally posted by kpedersen
View Post
Announcement
Collapse
No announcement yet.
GNU's Embed-Friendly Web Server Updated With Better OS Portability, Performance
Collapse
X
-
-
Originally posted by Venemo View PostIt's actually not a bug, but a part of the design. The documentation states that the callback function is called twice per request, in order to give you more flexibility:
If you have time, could you point a link to where you got that documentation from. I cannot seem to find it within the main docs here: https://www.gnu.org/software/libmicr...icrohttpd.html
Originally posted by quaz0r View Postits 2020 we have this thing called c++ now
Don't think of C as yet another language. Think of it as an entire platform. Without it, almost every other language will fall down.
- Likes 2
Leave a comment:
-
Originally posted by kpedersen View PostI looked into this a while back for a small project. It looked fairly decent. The only minor niggle was this weirdness:
Mirror from SVN of GNU libmicrohttpd. Contribute to rboulton/libmicrohttpd development by creating an account on GitHub.
Something about not responding on the first request because only the headers are sent? It looks like a massive hack how this is dealt with. I am not even sure why it is necessary. After deciding to write my own (BSD licensed), I never encountered this issue.
You can also see it on the main page here: https://www.gnu.org/software/libmicrohttpd/
Code:if (0 != strcmp(method, "GET")) return MHD_NO; /* unexpected method */ if (&dummy != *ptr) { /* The first time only the headers are valid, do not respond in the first round... */ *ptr = &dummy; return MHD_YES; }
The callback function for the respective URL will be called at least twice. The first call happens after the server has received the headers. The client should use the last void** argument to store internal context for the session. The first call to the callback function is mostly for this type of initialization and for internal access checks.
- Likes 4
Leave a comment:
-
Originally posted by bug77 View PostProbably nitpicking, but does a library provide a web server? I think a library is more likely to provide the tools for you to build/bootstrap your own server instead.
(Not bashing at anyone, it's just this thing I have about using the right term in the right spot. Probably some sort of CDO.)
- Likes 3
Leave a comment:
-
Probably nitpicking, but does a library provide a web server? I think a library is more likely to provide the tools for you to build/bootstrap your own server instead.
(Not bashing at anyone, it's just this thing I have about using the right term in the right spot. Probably some sort of CDO.)
- Likes 3
Leave a comment:
-
I looked into this a while back for a small project. It looked fairly decent. The only minor niggle was this weirdness:
Mirror from SVN of GNU libmicrohttpd. Contribute to rboulton/libmicrohttpd development by creating an account on GitHub.
Something about not responding on the first request because only the headers are sent? It looks like a massive hack how this is dealt with. I am not even sure why it is necessary. After deciding to write my own (BSD licensed), I never encountered this issue.
You can also see it on the main page here: https://www.gnu.org/software/libmicrohttpd/
Code:if (0 != strcmp(method, "GET")) return MHD_NO; /* unexpected method */ if (&dummy != *ptr) { /* The first time only the headers are valid, do not respond in the first round... */ *ptr = &dummy; return MHD_YES; }
- Likes 1
Leave a comment:
-
GNU's Embed-Friendly Web Server Updated With Better OS Portability, Performance
Phoronix: GNU's Embed-Friendly Web Server Updated With Better OS Portability, Performance
Libmicrohttpd as the GNU project's embedded HTTP web server library is out with a final release of 2020...
Tags: None
Leave a comment: