Announcement

Collapse
No announcement yet.

GNU's Embed-Friendly Web Server Updated With Better OS Portability, Performance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Venemo
    replied
    Originally posted by kpedersen View Post

    Many thanks for that. I just thought I wasn't quite "getting it"

    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
    On this page, scroll to the "Queueing responses" section: https://www.gnu.org/software/libmicrohttpd/

    Leave a comment:


  • numacross
    replied
    Originally posted by Vistaus View Post

    What *can't* Emacs do?
    Be a decent text editor?

    *hides*

    Leave a comment:


  • Vistaus
    replied
    Originally posted by rastersoft View Post

    No, it is integrated inside EMACS
    What *can't* Emacs do?

    Leave a comment:


  • kpedersen
    replied
    Originally posted by Venemo View Post
    It'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:
    Many thanks for that. I just thought I wasn't quite "getting it"

    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 Post
    its 2020 we have this thing called c++ now
    Believe it or not, the use of C things like void** makes it easier for binding developers to interface their languages of choice with the native library.

    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.

    Leave a comment:


  • quaz0r
    replied
    void**
    its 2020 we have this thing called c++ now

    Leave a comment:


  • Venemo
    replied
    Originally posted by kpedersen View Post
    I looked into this a while back for a small project. It looked fairly decent. The only minor niggle was this weirdness:

    https://github.com/rboulton/libmicro..._example.c#L47

    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;
    }
    Just seems a little bizarre.
    It'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:

    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.

    Leave a comment:


  • rastersoft
    replied
    Originally posted by bug77 View Post
    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.)
    No, it is integrated inside EMACS

    Leave a comment:


  • bug77
    replied
    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.)

    Leave a comment:


  • kpedersen
    replied
    I looked into this a while back for a small project. It looked fairly decent. The only minor niggle was this weirdness:

    https://github.com/rboulton/libmicro..._example.c#L47

    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;
    }
    Just seems a little bizarre.

    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...

    http://www.phoronix.com/scan.php?pag...rohttpd-0.9.72
Working...
X