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

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

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

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

    Comment


    • #3
      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.)

      Comment


      • #4
        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

        Comment


        • #5
          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:

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

          Comment


          • #6
            void**
            its 2020 we have this thing called c++ now

            Comment


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

              Comment


              • #8
                Originally posted by rastersoft View Post

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

                Comment


                • #9
                  Originally posted by Vistaus View Post

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

                  *hides*

                  Comment


                  • #10
                    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/

                    Comment

                    Working...
                    X