Home | History | Annotate | Download | only in doc
      1 This is libmicrohttpd.info, produced by makeinfo version 5.2 from
      2 libmicrohttpd.texi.
      3 
      4 This manual is for GNU libmicrohttpd (version 0.9.42, 3 April 2015), a
      5 library for embedding an HTTP(S) server into C applications.
      6 
      7    Copyright (C) 2007-2013 Christian Grothoff
      8 
      9      Permission is granted to copy, distribute and/or modify this
     10      document under the terms of the GNU Free Documentation License,
     11      Version 1.3 or any later version published by the Free Software
     12      Foundation; with no Invariant Sections, no Front-Cover Texts, and
     13      no Back-Cover Texts.  A copy of the license is included in the
     14      section entitled "GNU Free Documentation License".
     15 INFO-DIR-SECTION Software libraries
     16 START-INFO-DIR-ENTRY
     17 * libmicrohttpd: (libmicrohttpd).       Embedded HTTP server library.
     18 END-INFO-DIR-ENTRY
     19 
     20 
     21 File: libmicrohttpd.info,  Node: Top,  Next: microhttpd-intro,  Up: (dir)
     22 
     23 The GNU libmicrohttpd Library
     24 *****************************
     25 
     26 This manual is for GNU libmicrohttpd (version 0.9.42, 3 April 2015), a
     27 library for embedding an HTTP(S) server into C applications.
     28 
     29    Copyright (C) 2007-2013 Christian Grothoff
     30 
     31      Permission is granted to copy, distribute and/or modify this
     32      document under the terms of the GNU Free Documentation License,
     33      Version 1.3 or any later version published by the Free Software
     34      Foundation; with no Invariant Sections, no Front-Cover Texts, and
     35      no Back-Cover Texts.  A copy of the license is included in the
     36      section entitled "GNU Free Documentation License".
     37 
     38 * Menu:
     39 
     40 * microhttpd-intro::            Introduction.
     41 * microhttpd-const::            Constants.
     42 * microhttpd-struct::           Structures type definition.
     43 * microhttpd-cb::               Callback functions definition.
     44 * microhttpd-init::             Starting and stopping the server.
     45 * microhttpd-inspect::          Implementing external 'select'.
     46 * microhttpd-requests::         Handling requests.
     47 * microhttpd-responses::        Building responses to requests.
     48 * microhttpd-flow::             Flow control.
     49 * microhttpd-dauth::            Utilizing Authentication.
     50 * microhttpd-post::             Adding a 'POST' processor.
     51 * microhttpd-info::             Obtaining and modifying status information.
     52 * microhttpd-util::             Utilities.
     53 
     54 Appendices
     55 
     56 * GNU-LGPL::                     The GNU Lesser General Public License says how you
     57                                  can copy and share almost all of 'libmicrohttpd'.
     58 * GNU GPL with eCos Extension::  The GNU General Public License with eCos extension says how you
     59                                  can copy and share some parts of 'libmicrohttpd'.
     60 * GNU-FDL::                     The GNU Free Documentation License says how you
     61                                 can copy and share the documentation of 'libmicrohttpd'.
     62 
     63 Indices
     64 
     65 * Concept Index::               Index of concepts and programs.
     66 * Function and Data Index::     Index of functions, variables and data types.
     67 * Type Index::                  Index of data types.
     68 
     69 
     70 File: libmicrohttpd.info,  Node: microhttpd-intro,  Next: microhttpd-const,  Prev: Top,  Up: Top
     71 
     72 1 Introduction
     73 **************
     74 
     75 All symbols defined in the public API start with 'MHD_'.  MHD is a small
     76 HTTP daemon library.  As such, it does not have any API for logging
     77 errors (you can only enable or disable logging to stderr).  Also, it may
     78 not support all of the HTTP features directly, where applicable,
     79 portions of HTTP may have to be handled by clients of the library.
     80 
     81    The library is supposed to handle everything that it must handle
     82 (because the API would not allow clients to do this), such as basic
     83 connection management; however, detailed interpretations of headers --
     84 such as range requests -- and HTTP methods are left to clients.  The
     85 library does understand 'HEAD' and will only send the headers of the
     86 response and not the body, even if the client supplied a body.  The
     87 library also understands headers that control connection management
     88 (specifically, 'Connection: close' and 'Expect: 100 continue' are
     89 understood and handled automatically).
     90 
     91    MHD understands 'POST' data and is able to decode certain formats (at
     92 the moment only 'application/x-www-form-urlencoded' and
     93 'multipart/form-data') using the post processor API. The data stream of
     94 a POST is also provided directly to the main application, so unsupported
     95 encodings could still be processed, just not conveniently by MHD.
     96 
     97    The header file defines various constants used by the HTTP protocol.
     98 This does not mean that MHD actually interprets all of these values.
     99 The provided constants are exported as a convenience for users of the
    100 library.  MHD does not verify that transmitted HTTP headers are part of
    101 the standard specification; users of the library are free to define
    102 their own extensions of the HTTP standard and use those with MHD.
    103 
    104    All functions are guaranteed to be completely reentrant and
    105 thread-safe.  MHD checks for allocation failures and tries to recover
    106 gracefully (for example, by closing the connection).  Additionally,
    107 clients can specify resource limits on the overall number of
    108 connections, number of connections per IP address and memory used per
    109 connection to avoid resource exhaustion.
    110 
    111 1.1 Scope
    112 =========
    113 
    114 MHD is currently used in a wide range of implementations.  Examples
    115 based on reports we've received from developers include:
    116    * Embedded HTTP server on a cortex M3 (128 KB code space)
    117    * Large-scale multimedia server (reportedly serving at the simulator
    118      limit of 7.5 GB/s)
    119    * Administrative console (via HTTP/HTTPS) for network appliances
    120 
    121 1.2 Thread modes and event loops
    122 ================================
    123 
    124 MHD supports four basic thread modes and up to three event loop styes.
    125 
    126    The four basic thread modes are external (MHD creates no threads,
    127 event loop is fully managed by the application), internal (MHD creates
    128 one thread for all connections), thread pool (MHD creates a thread pool
    129 which is used to process all connections) and thread-per-connection (MHD
    130 creates one listen thread and then one thread per accepted connection).
    131 
    132    These thread modes are then combined with the event loop styles.  MHD
    133 support select, poll and epoll.  epoll is only available on Linux, poll
    134 may not be available on some platforms.  Note that it is possible to
    135 combine MHD using epoll with an external select-based event loop.
    136 
    137    The default (if no other option is passed) is "external select".  The
    138 highest performance can typically be obtained with a thread pool using
    139 'epoll'.  Apache Benchmark (ab) was used to compare the performance of
    140 'select' and 'epoll' when using a thread pool and a large number of
    141 connections.  *note Figure 1.1: fig:performance. shows the resulting
    142 plot from the 'benchmark.c' example, which measures the latency between
    143 an incoming request and the completion of the transmission of the
    144 response.  In this setting, the 'epoll' thread pool with four threads
    145 was able to handle more than 45,000 connections per second on loopback
    146 (with Apache Benchmark running three processes on the same machine).
    147 
    148 [image src="performance_data.png" alt="Data"]
    149 
    150 Figure 1.1: Performance measurements for select vs.  epoll (with
    151 thread-pool).
    152 
    153    Not all combinations of thread modes and event loop styles are
    154 supported.  This is partially to keep the API simple, and partially
    155 because some combinations simply make no sense as others are strictly
    156 superior.  Note that the choice of style depends fist of all on the
    157 application logic, and then on the performance requirements.
    158 Applications that perform a blocking operation while handling a request
    159 within the callbacks from MHD must use a thread per connection.  This is
    160 typically rather costly.  Applications that do not support threads or
    161 that must run on embedded devices without thread-support must use the
    162 external mode.  Using 'epoll' is only supported on Linux, thus portable
    163 applications must at least have a fallback option available.  *note
    164 Table 1.1: tbl:supported. lists the sane combinations.
    165 
    166                         select   poll   epoll
    167 external                yes      no     yes
    168 internal                yes      yes    yes
    169 thread pool             yes      yes    yes
    170 thread-per-connection   yes      yes    no
    171 
    172 Table 1.1: Supported combinations of event styles and thread modes.
    173 
    174 1.3 Compiling GNU libmicrohttpd
    175 ===============================
    176 
    177 MHD uses the standard GNU system where the usual build process involves
    178 running
    179 $ ./configure
    180 $ make
    181 $ make install
    182 
    183    MHD supports various options to be given to configure to tailor the
    184 binary to a specific situation.  Note that some of these options will
    185 remove portions of the MHD code that are required for
    186 binary-compatibility.  They should only be used on embedded systems with
    187 tight resource constraints and no concerns about library versioning.
    188 Standard distributions including MHD are expected to always ship with
    189 all features enabled, otherwise unexpected incompatibilities can arise!
    190 
    191    Here is a list of MHD-specific options that can be given to configure
    192 (canonical configure options such as "-prefix" are also supported, for a
    193 full list of options run "./configure -help"):
    194 
    195 '``--disable-curl'''
    196      disable running testcases using libcurl
    197 
    198 '``--disable-largefile'''
    199      disable support for 64-bit files
    200 
    201 '``--disable-messages'''
    202      disable logging of error messages (smaller binary size, not so much
    203      fun for debugging)
    204 
    205 '``--disable-https'''
    206      disable HTTPS support, even if GNUtls is found; this option must be
    207      used if eCOS license is desired as an option (in all cases the
    208      resulting binary falls under a GNU LGPL-only license)
    209 
    210 '``--disable-postprocessor'''
    211      do not include the post processor API (results in binary
    212      incompatibility)
    213 
    214 '``--disable-dauth'''
    215      do not include the authentication APIs (results in binary
    216      incompatibility)
    217 
    218 '``--disable-epoll'
    219      do not include epoll support, even on Linux (minimally smaller
    220      binary size, good for testing portability to non-Linux systems)
    221 
    222 '``--enable-coverage'''
    223      set flags for analysis of code-coverage with gcc/gcov (results in
    224      slow, large binaries)
    225 
    226 '``--with-gcrypt=PATH'''
    227      specifies path to libgcrypt installation
    228 
    229 '``--with-gnutls=PATH'''
    230      specifies path to libgnutls installation
    231 
    232 1.4 Validity of pointers
    233 ========================
    234 
    235 MHD will give applications access to its internal data structures via
    236 pointers via arguments and return values from its API. This creates the
    237 question as to how long those pointers are assured to stay valid.
    238 
    239    Most MHD data structures are associated with the connection of an
    240 HTTP client.  Thus, pointers associated with a connection are typically
    241 valid until the connection is finished, at which point MHD will call the
    242 'MHD_RequestCompletedCallback' if one is registered.  Applications that
    243 have such a callback registered may assume that keys and values from the
    244 'MHD_KeyValueIterator', return values from 'MHD_lookup_connection_value'
    245 and the 'url', 'method' and 'version' arguments to the
    246 'MHD_AccessHandlerCallback' will remain valid until the respective
    247 'MHD_RequestCompletedCallback' is invoked.
    248 
    249    In contrast, the 'upload_data' argument of
    250 'MHD_RequestCompletedCallback' as well as all pointers from the
    251 'MHD_PostDataIterator' are only valid for the duration of the callback.
    252 
    253    Pointers returned from 'MHD_get_response_header' are valid as long as
    254 the response itself is valid.
    255 
    256 1.5 Including the microhttpd.h header
    257 =====================================
    258 
    259 Ideally, before including "microhttpd.h" you should add the necessary
    260 includes to define the 'uint64_t', 'size_t', 'fd_set', 'socklen_t' and
    261 'struct sockaddr' data types.  Which specific headers are needed may
    262 depend on your platform and your build system might include some tests
    263 to provide you with the necessary conditional operations.  For possible
    264 suggestions consult 'platform.h' and 'configure.ac' in the MHD
    265 distribution.
    266 
    267    Once you have ensured that you manually (!)  included the right
    268 headers for your platform before "microhttpd.h", you should also add a
    269 line with '#define MHD_PLATFORM_H' which will prevent the "microhttpd.h"
    270 header from trying (and, depending on your platform, failing) to include
    271 the right headers.
    272 
    273    If you do not define MHD_PLATFORM_H, the "microhttpd.h" header will
    274 automatically include headers needed on GNU/Linux systems (possibly
    275 causing problems when porting to other platforms).
    276 
    277 1.6 SIGPIPE
    278 ===========
    279 
    280 MHD does not install a signal handler for SIGPIPE. On platforms where
    281 this is possible (such as GNU/Linux), it disables SIGPIPE for its I/O
    282 operations (by passing MSG_NOSIGNAL). On other platforms, SIGPIPE
    283 signals may be generated from network operations by MHD and will cause
    284 the process to die unless the developer explicitly installs a signal
    285 handler for SIGPIPE.
    286 
    287    Hence portable code using MHD must install a SIGPIPE handler or
    288 explicitly block the SIGPIPE signal.  MHD does not do so in order to
    289 avoid messing with other parts of the application that may need to
    290 handle SIGPIPE in a particular way.  You can make your application
    291 handle SIGPIPE by calling the following function in 'main':
    292 
    293 static void
    294 catcher (int sig)
    295 {
    296 }
    297 
    298 static void
    299 ignore_sigpipe ()
    300 {
    301   struct sigaction oldsig;
    302   struct sigaction sig;
    303 
    304   sig.sa_handler = &catcher;
    305   sigemptyset (&sig.sa_mask);
    306 #ifdef SA_INTERRUPT
    307   sig.sa_flags = SA_INTERRUPT;  /* SunOS */
    308 #else
    309   sig.sa_flags = SA_RESTART;
    310 #endif
    311   if (0 != sigaction (SIGPIPE, &sig, &oldsig))
    312     fprintf (stderr,
    313              "Failed to install SIGPIPE handler: %s\n", strerror (errno));
    314 }
    315 
    316 1.7 MHD_UNSIGNED_LONG_LONG
    317 ==========================
    318 
    319 Some platforms do not support 'long long'.  Hence MHD defines a macro
    320 'MHD_UNSIGNED LONG_LONG' which will default to 'unsigned long long'.
    321 For standard desktop operating systems, this is all you need to know.
    322 
    323    However, if your platform does not support 'unsigned long long', you
    324 should change "platform.h" to define 'MHD_LONG_LONG' and
    325 'MHD_UNSIGNED_LONG_LONG' to an appropriate alternative type and also
    326 define 'MHD_LONG_LONG_PRINTF' and 'MHD_UNSIGNED_LONG_LONG_PRINTF' to the
    327 corresponding format string for printing such a data type.  Note that
    328 the "signed" versions are deprecated.  Also, for historical reasons,
    329 'MHD_LONG_LONG_PRINTF' is without the percent sign, whereas
    330 'MHD_UNSIGNED_LONG_LONG_PRINTF' is with the percent sign.  Newly written
    331 code should only use the unsigned versions.  However, you need to define
    332 both in "platform.h" if you need to change the definition for the
    333 specific platform.
    334 
    335 1.8 Portability to W32
    336 ======================
    337 
    338 libmicrohttpd in general ported well to W32.  Most libmicrohttpd
    339 features are supported.  W32 do not support some functions, like epoll
    340 and corresponding MHD features are not available on W32.
    341 
    342 1.9 Portability to z/OS
    343 =======================
    344 
    345 To compile MHD on z/OS, extract the archive and run
    346 
    347 iconv -f UTF-8 -t IBM-1047 contrib/ascebc > /tmp/ascebc.sh
    348 chmod +x /tmp/ascebc.sh
    349 for n in `find * -type f`
    350 do
    351   /tmp/ascebc.sh $n
    352 done
    353    to convert all source files to EBCDIC. Note that you must run
    354 'configure' from the directory where the configure script is located.
    355 Otherwise, configure will fail to find the 'contrib/xcc' script (which
    356 is a wrapper around the z/OS c89 compiler).
    357 
    358 
    359 File: libmicrohttpd.info,  Node: microhttpd-const,  Next: microhttpd-struct,  Prev: microhttpd-intro,  Up: Top
    360 
    361 2 Constants
    362 ***********
    363 
    364  -- Enumeration: MHD_FLAG
    365      Options for the MHD daemon.
    366 
    367      Note that if neither 'MHD_USE_THREAD_PER_CONNECTION' nor
    368      'MHD_USE_SELECT_INTERNALLY' is used, the client wants control over
    369      the process and will call the appropriate microhttpd callbacks.
    370 
    371      Starting the daemon may also fail if a particular option is not
    372      implemented or not supported on the target platform (i.e.  no
    373      support for SSL, threads or IPv6).  SSL support generally depends
    374      on options given during MHD compilation.  Threaded operations
    375      (including 'MHD_USE_SELECT_INTERNALLY') are not supported on
    376      Symbian.
    377 
    378      'MHD_NO_FLAG'
    379           No options selected.
    380 
    381      'MHD_USE_DEBUG'
    382           Run in debug mode.  If this flag is used, the library should
    383           print error messages and warnings to stderr.  Note that for
    384           this run-time option to have any effect, MHD needs to be
    385           compiled with messages enabled.  This is done by default
    386           except you ran configure with the '--disable-messages' flag
    387           set.
    388 
    389      'MHD_USE_SSL'
    390           Run in HTTPS-mode.  If you specify 'MHD_USE_SSL' and MHD was
    391           compiled without SSL support, 'MHD_start_daemon' will return
    392           NULL.
    393 
    394      'MHD_USE_THREAD_PER_CONNECTION'
    395           Run using one thread per connection.
    396 
    397      'MHD_USE_SELECT_INTERNALLY'
    398           Run using an internal thread doing 'SELECT'.
    399 
    400      'MHD_USE_IPv6'
    401           Run using the IPv6 protocol (otherwise, MHD will just support
    402           IPv4).  If you specify 'MHD_USE_IPV6' and the local platform
    403           does not support it, 'MHD_start_daemon' will return NULL.
    404 
    405           If you want MHD to support IPv4 and IPv6 using a single
    406           socket, pass MHD_USE_DUAL_STACK, otherwise, if you only pass
    407           this option, MHD will try to bind to IPv6-only (resulting in
    408           no IPv4 support).
    409 
    410      'MHD_USE_DUAL_STACK'
    411           Use a single socket for IPv4 and IPv6.  Note that this will
    412           mean that IPv4 addresses are returned by MHD in the
    413           IPv6-mapped format (the 'struct sockaddr_in6' format will be
    414           used for IPv4 and IPv6).
    415 
    416      'MHD_USE_PEDANTIC_CHECKS'
    417           Be pedantic about the protocol (as opposed to as tolerant as
    418           possible).  Specifically, at the moment, this flag causes MHD
    419           to reject HTTP 1.1 connections without a 'Host' header.  This
    420           is required by the standard, but of course in violation of the
    421           "be as liberal as possible in what you accept" norm.  It is
    422           recommended to turn this *ON* if you are testing clients
    423           against MHD, and *OFF* in production.
    424 
    425      'MHD_USE_POLL'
    426           Use poll instead of select.  This allows sockets with
    427           descriptors '>= FD_SETSIZE'.  This option currently only works
    428           in conjunction with 'MHD_USE_THREAD_PER_CONNECTION' or
    429           'MHD_USE_INTERNAL_SELECT' (at this point).  If you specify
    430           'MHD_USE_POLL' and the local platform does not support it,
    431           'MHD_start_daemon' will return NULL.
    432 
    433      'MHD_USE_EPOLL_LINUX_ONLY'
    434           Use epoll instead of poll or select.  This allows sockets with
    435           descriptors '>= FD_SETSIZE'.  This option is only available on
    436           Linux systems and only works in conjunction with
    437           'MHD_USE_THREAD_PER_CONNECTION' (at this point).  If you
    438           specify 'MHD_USE_EPOLL_LINUX_ONLY' and the local platform does
    439           not support it, 'MHD_start_daemon' will return NULL. Using
    440           epoll instead of select or poll can in some situations result
    441           in significantly higher performance as the system call has
    442           fundamentally lower complexity (O(1) for epoll vs.  O(n) for
    443           select/poll where n is the number of open connections).
    444 
    445      'MHD_SUPPRESS_DATE_NO_CLOCK'
    446           Suppress (automatically) adding the 'Date:' header to HTTP
    447           responses.  This option should ONLY be used on systems that do
    448           not have a clock and that DO provide other mechanisms for
    449           cache control.  See also RFC 2616, section 14.18 (exception
    450           3).
    451 
    452      'MHD_USE_NO_LISTEN_SOCKET'
    453           Run the HTTP server without any listen socket.  This option
    454           only makes sense if 'MHD_add_connection' is going to be used
    455           exclusively to connect HTTP clients to the HTTP server.  This
    456           option is incompatible with using a thread pool; if it is
    457           used, 'MHD_OPTION_THREAD_POOL_SIZE' is ignored.
    458 
    459      'MHD_USE_PIPE_FOR_SHUTDOWN'
    460           Force MHD to use a signal pipe to notify the event loop (of
    461           threads) of our shutdown.  This is required if an appliction
    462           uses 'MHD_USE_INTERNAL_SELECT' or
    463           'MHD_USE_THREAD_PER_CONNECTION' and then performs
    464           'MHD_quiesce_daemon' (which eliminates our ability to signal
    465           termination via the listen socket).  In these modes,
    466           'MHD_quiesce_daemon' will fail if this option was not set.
    467           Also, use of this option is automatic (as in, you do not even
    468           have to specify it), if 'MHD_USE_NO_LISTEN_SOCKET' is
    469           specified.  In "external" select mode, this option is always
    470           simply ignored.
    471 
    472      'MHD_USE_SUSPEND_RESUME'
    473           Enables using 'MHD_suspend_connection' and
    474           'MHD_resume_connection', as performing these calls requires
    475           some additional pipes to be created, and code not using these
    476           calls should not pay the cost.
    477 
    478      'MHD_USE_TCP_FASTOPEN'
    479           Enable TCP_FASTOPEN on the listen socket.  TCP_FASTOPEN is
    480           currently supported on Linux >= 3.6.  On other systems using
    481           this option with cause 'MHD_start_daemon' to fail.
    482 
    483  -- Enumeration: MHD_OPTION
    484      MHD options.  Passed in the varargs portion of
    485      'MHD_start_daemon()'.
    486 
    487      'MHD_OPTION_END'
    488           No more options / last option.  This is used to terminate the
    489           VARARGs list.
    490 
    491      'MHD_OPTION_CONNECTION_MEMORY_LIMIT'
    492           Maximum memory size per connection (followed by a 'size_t').
    493           The default is 32 kB (32*1024 bytes) as defined by the
    494           internal constant 'MHD_POOL_SIZE_DEFAULT'.  Values above 128k
    495           are unlikely to result in much benefit, as half of the memory
    496           will be typically used for IO, and TCP buffers are unlikely to
    497           support window sizes above 64k on most systems.
    498 
    499      'MHD_OPTION_CONNECTION_MEMORY_INCREMENT'
    500           Increment to use for growing the read buffer (followed by a
    501           'size_t').  The default is 1024 (bytes).  Increasing this
    502           value will make MHD use memory for reading more aggressively,
    503           which can reduce the number of 'recvfrom' calls but may
    504           increase the number of 'sendto' calls.  The given value must
    505           fit within MHD_OPTION_CONNECTION_MEMORY_LIMIT.
    506 
    507      'MHD_OPTION_CONNECTION_LIMIT'
    508           Maximum number of concurrent connections to accept (followed
    509           by an 'unsigned int').  The default is 'FD_SETSIZE - 4' (the
    510           maximum number of file descriptors supported by 'select' minus
    511           four for 'stdin', 'stdout', 'stderr' and the server socket).
    512           In other words, the default is as large as possible.
    513 
    514           Note that if you set a low connection limit, you can easily
    515           get into trouble with browsers doing request pipelining.  For
    516           example, if your connection limit is "1", a browser may open a
    517           first connection to access your "index.html" file, keep it
    518           open but use a second connection to retrieve CSS files, images
    519           and the like.  In fact, modern browsers are typically by
    520           default configured for up to 15 parallel connections to a
    521           single server.  If this happens, MHD will refuse to even
    522           accept the second connection until the first connection is
    523           closed -- which does not happen until timeout.  As a result,
    524           the browser will fail to render the page and seem to hang.  If
    525           you expect your server to operate close to the connection
    526           limit, you should first consider using a lower timeout value
    527           and also possibly add a "Connection: close" header to your
    528           response to ensure that request pipelining is not used and
    529           connections are closed immediately after the request has
    530           completed:
    531                MHD_add_response_header (response,
    532                                         MHD_HTTP_HEADER_CONNECTION,
    533                                         "close");
    534 
    535      'MHD_OPTION_CONNECTION_TIMEOUT'
    536           After how many seconds of inactivity should a connection
    537           automatically be timed out?  (followed by an 'unsigned int';
    538           use zero for no timeout).  The default is zero (no timeout).
    539 
    540      'MHD_OPTION_NOTIFY_COMPLETED'
    541           Register a function that should be called whenever a request
    542           has been completed (this can be used for application-specific
    543           clean up).  Requests that have never been presented to the
    544           application (via 'MHD_AccessHandlerCallback()') will not
    545           result in notifications.
    546 
    547           This option should be followed by *TWO* pointers.  First a
    548           pointer to a function of type 'MHD_RequestCompletedCallback()'
    549           and second a pointer to a closure to pass to the request
    550           completed callback.  The second pointer maybe 'NULL'.
    551 
    552      'MHD_OPTION_NOTIFY_CONNECTION'
    553           Register a function that should be called when the TCP
    554           connection to a client is opened or closed.  Note that
    555           'MHD_OPTION_NOTIFY_COMPLETED' and the 'con_cls' argument to
    556           the 'MHD_AccessHandlerCallback' are per HTTP request (and
    557           there can be multiple HTTP requests per TCP connection).  The
    558           registered callback is called twice per TCP connection, with
    559           'MHD_CONNECTION_NOTIFY_STARTED' and
    560           'MHD_CONNECTION_NOTIFY_CLOSED' respectively.  An additional
    561           argument can be used to store TCP connection specific
    562           information, which can be retrieved using
    563           'MHD_CONNECTION_INFO_SOCKET_CONTEXT' during the lifetime of
    564           the TCP connection.  The respective location is not the same
    565           as the HTTP-request-specific 'con_cls' from the
    566           'MHD_AccessHandlerCallback'.
    567 
    568           This option should be followed by *TWO* pointers.  First a
    569           pointer to a function of type 'MHD_NotifyConnectionCallback()'
    570           and second a pointer to a closure to pass to the request
    571           completed callback.  The second pointer maybe 'NULL'.
    572 
    573      'MHD_OPTION_PER_IP_CONNECTION_LIMIT'
    574           Limit on the number of (concurrent) connections made to the
    575           server from the same IP address.  Can be used to prevent one
    576           IP from taking over all of the allowed connections.  If the
    577           same IP tries to establish more than the specified number of
    578           connections, they will be immediately rejected.  The option
    579           should be followed by an 'unsigned int'.  The default is zero,
    580           which means no limit on the number of connections from the
    581           same IP address.
    582 
    583      'MHD_OPTION_SOCK_ADDR'
    584           Bind daemon to the supplied socket address.  This option
    585           should be followed by a 'struct sockaddr *'.  If
    586           'MHD_USE_IPv6' is specified, the 'struct sockaddr*' should
    587           point to a 'struct sockaddr_in6', otherwise to a 'struct
    588           sockaddr_in'.  If this option is not specified, the daemon
    589           will listen to incoming connections from anywhere.  If you use
    590           this option, the 'port' argument from 'MHD_start_daemon' is
    591           ignored and the port from the given 'struct sockaddr *' will
    592           be used instead.
    593 
    594      'MHD_OPTION_URI_LOG_CALLBACK'
    595           Specify a function that should be called before parsing the
    596           URI from the client.  The specified callback function can be
    597           used for processing the URI (including the options) before it
    598           is parsed.  The URI after parsing will no longer contain the
    599           options, which maybe inconvenient for logging.  This option
    600           should be followed by two arguments, the first one must be of
    601           the form
    602                 void * my_logger(void * cls, const char * uri, struct MHD_Connection *con)
    603           where the return value will be passed as '*con_cls' in calls
    604           to the 'MHD_AccessHandlerCallback' when this request is
    605           processed later; returning a value of 'NULL' has no special
    606           significance; (however, note that if you return non-'NULL',
    607           you can no longer rely on the first call to the access handler
    608           having 'NULL == *con_cls' on entry) 'cls' will be set to the
    609           second argument following MHD_OPTION_URI_LOG_CALLBACK.
    610           Finally, 'uri' will be the 0-terminated URI of the request.
    611 
    612           Note that during the time of this call, most of the
    613           connection's state is not initialized (as we have not yet
    614           parsed he headers).  However, information about the connecting
    615           client (IP, socket) is available.
    616 
    617      'MHD_OPTION_HTTPS_MEM_KEY'
    618           Memory pointer to the private key to be used by the HTTPS
    619           daemon.  This option should be followed by an "const char*"
    620           argument.  This should be used in conjunction with
    621           'MHD_OPTION_HTTPS_MEM_CERT'.
    622 
    623      'MHD_OPTION_HTTPS_KEY_PASSWORD'
    624           Memory pointer to the password that decrypts the private key
    625           to be used by the HTTPS daemon.  This option should be
    626           followed by an "const char*" argument.  This should be used in
    627           conjunction with 'MHD_OPTION_HTTPS_MEM_KEY'.
    628 
    629           The password (or passphrase) is only used immediately during
    630           'MHD_start_daemon()'.  Thus, the application may want to erase
    631           it from memory afterwards for additional security.
    632 
    633      'MHD_OPTION_HTTPS_MEM_CERT'
    634           Memory pointer to the certificate to be used by the HTTPS
    635           daemon.  This option should be followed by an "const char*"
    636           argument.  This should be used in conjunction with
    637           'MHD_OPTION_HTTPS_MEM_KEY'.
    638 
    639      'MHD_OPTION_HTTPS_MEM_TRUST'
    640           Memory pointer to the CA certificate to be used by the HTTPS
    641           daemon to authenticate and trust clients certificates.  This
    642           option should be followed by an "const char*" argument.  The
    643           presence of this option activates the request of certificate
    644           to the client.  The request to the client is marked optional,
    645           and it is the responsibility of the server to check the
    646           presence of the certificate if needed.  Note that most
    647           browsers will only present a client certificate only if they
    648           have one matching the specified CA, not sending any
    649           certificate otherwise.
    650 
    651      'MHD_OPTION_HTTPS_CRED_TYPE'
    652           Daemon credentials type.  Either certificate or anonymous,
    653           this option should be followed by one of the values listed in
    654           "enum gnutls_credentials_type_t".
    655 
    656      'MHD_OPTION_HTTPS_PRIORITIES'
    657           SSL/TLS protocol version and ciphers.  This option must be
    658           followed by an "const char *" argument specifying the SSL/TLS
    659           protocol versions and ciphers that are acceptable for the
    660           application.  The string is passed unchanged to
    661           gnutls_priority_init.  If this option is not specified,
    662           "NORMAL" is used.
    663 
    664      'MHD_OPTION_HTTPS_CERT_CALLBACK'
    665           Use a callback to determine which X.509 certificate should be
    666           used for a given HTTPS connection.  This option should be
    667           followed by a argument of type
    668           "gnutls_certificate_retrieve_function2 *".  This option
    669           provides an alternative to MHD_OPTION_HTTPS_MEM_KEY and
    670           MHD_OPTION_HTTPS_MEM_CERT. You must use this version if
    671           multiple domains are to be hosted at the same IP address using
    672           TLS's Server Name Indication (SNI) extension.  In this case,
    673           the callback is expected to select the correct certificate
    674           based on the SNI information provided.  The callback is
    675           expected to access the SNI data using
    676           gnutls_server_name_get().  Using this option requires GnuTLS
    677           3.0 or higher.
    678 
    679      'MHD_OPTION_DIGEST_AUTH_RANDOM'
    680           Digest Authentication nonce's seed.
    681 
    682           This option should be followed by two arguments.  First an
    683           integer of type "size_t" which specifies the size of the
    684           buffer pointed to by the second argument in bytes.  Note that
    685           the application must ensure that the buffer of the second
    686           argument remains allocated and unmodified while the daemon is
    687           running.  For security, you SHOULD provide a fresh random
    688           nonce when using MHD with Digest Authentication.
    689 
    690      'MHD_OPTION_NONCE_NC_SIZE'
    691 
    692           Size of an array of nonce and nonce counter map.  This option
    693           must be followed by an "unsigned int" argument that have the
    694           size (number of elements) of a map of a nonce and a
    695           nonce-counter.  If this option is not specified, a default
    696           value of 4 will be used (which might be too small for servers
    697           handling many requests).  If you do not use digest
    698           authentication at all, you can specify a value of zero to save
    699           some memory.
    700 
    701           You should calculate the value of NC_SIZE based on the number
    702           of connections per second multiplied by your expected session
    703           duration plus a factor of about two for hash table collisions.
    704           For example, if you expect 100 digest-authenticated
    705           connections per second and the average user to stay on your
    706           site for 5 minutes, then you likely need a value of about
    707           60000.  On the other hand, if you can only expect only 10
    708           digest-authenticated connections per second, tolerate browsers
    709           getting a fresh nonce for each request and expect a HTTP
    710           request latency of 250 ms, then a value of about 5 should be
    711           fine.
    712 
    713      'MHD_OPTION_LISTEN_SOCKET'
    714           Listen socket to use.  Pass a listen socket for MHD to use
    715           (systemd-style).  If this option is used, MHD will not open
    716           its own listen socket(s).  The argument passed must be of type
    717           "int" and refer to an existing socket that has been bound to a
    718           port and is listening.
    719 
    720      'MHD_OPTION_EXTERNAL_LOGGER'
    721           Use the given function for logging error messages.  This
    722           option must be followed by two arguments; the first must be a
    723           pointer to a function of type 'void fun(void * arg, const char
    724           * fmt, va_list ap)' and the second a pointer of type 'void*'
    725           which will be passed as the "arg" argument to "fun".
    726 
    727           Note that MHD will not generate any log messages without the
    728           MHD_USE_DEBUG flag set and if MHD was compiled with the
    729           "-disable-messages" flag.
    730 
    731      'MHD_OPTION_THREAD_POOL_SIZE'
    732           Number (unsigned int) of threads in thread pool.  Enable
    733           thread pooling by setting this value to to something greater
    734           than 1.  Currently, thread model must be
    735           MHD_USE_SELECT_INTERNALLY if thread pooling is enabled
    736           ('MHD_start_daemon' returns 'NULL' for an unsupported thread
    737           model).
    738 
    739      'MHD_OPTION_ARRAY'
    740           This option can be used for initializing MHD using options
    741           from an array.  A common use for this is writing an FFI for
    742           MHD. The actual options given are in an array of 'struct
    743           MHD_OptionItem', so this option requires a single argument of
    744           type 'struct MHD_OptionItem'.  The array must be terminated
    745           with an entry 'MHD_OPTION_END'.
    746 
    747           An example for code using MHD_OPTION_ARRAY is:
    748                struct MHD_OptionItem ops[] = {
    749                 { MHD_OPTION_CONNECTION_LIMIT, 100, NULL },
    750                 { MHD_OPTION_CONNECTION_TIMEOUT, 10, NULL },
    751                 { MHD_OPTION_END, 0, NULL }
    752                };
    753                d = MHD_start_daemon(0, 8080, NULL, NULL, dh, NULL,
    754                                     MHD_OPTION_ARRAY, ops,
    755                                     MHD_OPTION_END);
    756           For options that expect a single pointer argument, the second
    757           member of the 'struct MHD_OptionItem' is ignored.  For options
    758           that expect two pointer arguments, the first argument must be
    759           cast to 'intptr_t'.
    760 
    761      'MHD_OPTION_UNESCAPE_CALLBACK'
    762 
    763           Specify a function that should be called for unescaping escape
    764           sequences in URIs and URI arguments.  Note that this function
    765           will NOT be used by the MHD_PostProcessor.  If this option is
    766           not specified, the default method will be used which decodes
    767           escape sequences of the form "%HH". This option should be
    768           followed by two arguments, the first one must be of the form
    769 
    770                  size_t my_unescaper(void * cls, struct MHD_Connection *c, char *s)
    771 
    772           where the return value must be 'strlen(s)' and 's' should be
    773           updated.  Note that the unescape function must not lengthen
    774           's' (the result must be shorter than the input and still be
    775           0-terminated).  'cls' will be set to the second argument
    776           following MHD_OPTION_UNESCAPE_CALLBACK.
    777 
    778      'MHD_OPTION_THREAD_STACK_SIZE'
    779           Maximum stack size for threads created by MHD. This option
    780           must be followed by a 'size_t').  Not specifying this option
    781           or using a value of zero means using the system default (which
    782           is likely to differ based on your platform).
    783 
    784      'MHD_OPTION_TCP_FASTQUEUE_QUEUE_SIZE'
    785           When the flag 'MHD_USE_TCP_FASTOPEN' is used, this option sets
    786           the connection handshake queue size for the TCP FASTOPEN
    787           connections.  Note that a TCP FASTOPEN connection handshake
    788           occupies more resources than a TCP handshake as the SYN
    789           packets also contain DATA which is kept in the associate state
    790           until handshake is completed.  If this option is not given the
    791           queue size is set to a default value of 10.  This option must
    792           be followed by a 'unsigned int'.
    793 
    794      'MHD_OPTION_HTTPS_MEM_DHPARAMS'
    795           Memory pointer for the Diffie-Hellman parameters (dh.pem) to
    796           be used by the HTTPS daemon for key exchange.  This option
    797           must be followed by a 'const char *' argument.  The argument
    798           would be a zero-terminated string with a PEM encoded PKCS3 DH
    799           parameters structure suitable for passing to
    800           'gnutls_dh_parms_import_pkcs3'.
    801 
    802      'MHD_OPTION_LISTENING_ADDRESS_REUSE'
    803           This option must be followed by a 'unsigned int' argument.  If
    804           this option is present and true (nonzero) parameter is given,
    805           allow reusing the address:port of the listening socket (using
    806           'SO_REUSEPORT' on most platforms, and 'SO_REUSEADDR' on
    807           Windows).  If a false (zero) parameter is given, disallow
    808           reusing the the address:port of the listening socket (this
    809           usually requires no special action, but 'SO_EXCLUSIVEADDRUSE'
    810           is needed on Windows).  If this option is not present, default
    811           behaviour is undefined (currently, 'SO_REUSEADDR' is used on
    812           all platforms, which disallows address:port reusing with the
    813           exception of Windows).
    814 
    815  -- C Struct: MHD_OptionItem
    816      Entry in an MHD_OPTION_ARRAY. See the 'MHD_OPTION_ARRAY' option
    817      argument for its use.
    818 
    819      The 'option' member is used to specify which option is specified in
    820      the array.  The other members specify the respective argument.
    821 
    822      Note that for options taking only a single pointer, the 'ptr_value'
    823      member should be set.  For options taking two pointer arguments,
    824      the first pointer must be cast to 'intptr_t' and both the 'value'
    825      and the 'ptr_value' members should be used to pass the two
    826      pointers.
    827 
    828  -- Enumeration: MHD_ValueKind
    829      The 'MHD_ValueKind' specifies the source of the key-value pairs in
    830      the HTTP protocol.
    831 
    832      'MHD_RESPONSE_HEADER_KIND'
    833           Response header.
    834 
    835      'MHD_HEADER_KIND'
    836           HTTP header.
    837 
    838      'MHD_COOKIE_KIND'
    839           Cookies.  Note that the original HTTP header containing the
    840           cookie(s) will still be available and intact.
    841 
    842      'MHD_POSTDATA_KIND'
    843           'POST' data.  This is available only if a content encoding
    844           supported by MHD is used (currently only URL encoding), and
    845           only if the posted content fits within the available memory
    846           pool.  Note that in that case, the upload data given to the
    847           'MHD_AccessHandlerCallback()' will be empty (since it has
    848           already been processed).
    849 
    850      'MHD_GET_ARGUMENT_KIND'
    851           'GET' (URI) arguments.
    852 
    853      'MHD_FOOTER_KIND'
    854           HTTP footer (only for http 1.1 chunked encodings).
    855 
    856  -- Enumeration: MHD_RequestTerminationCode
    857      The 'MHD_RequestTerminationCode' specifies reasons why a request
    858      has been terminated (or completed).
    859 
    860      'MHD_REQUEST_TERMINATED_COMPLETED_OK'
    861           We finished sending the response.
    862 
    863      'MHD_REQUEST_TERMINATED_WITH_ERROR'
    864           Error handling the connection (resources exhausted, other side
    865           closed connection, application error accepting request, etc.)
    866 
    867      'MHD_REQUEST_TERMINATED_TIMEOUT_REACHED'
    868           No activity on the connection for the number of seconds
    869           specified using 'MHD_OPTION_CONNECTION_TIMEOUT'.
    870 
    871      'MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN'
    872           We had to close the session since MHD was being shut down.
    873 
    874  -- Enumeration: MHD_ResponseMemoryMode
    875      The 'MHD_ResponeMemoryMode' specifies how MHD should treat the
    876      memory buffer given for the response in
    877      'MHD_create_response_from_buffer'.
    878 
    879      'MHD_RESPMEM_PERSISTENT'
    880           Buffer is a persistent (static/global) buffer that won't
    881           change for at least the lifetime of the response, MHD should
    882           just use it, not free it, not copy it, just keep an alias to
    883           it.
    884 
    885      'MHD_RESPMEM_MUST_FREE'
    886           Buffer is heap-allocated with 'malloc' (or equivalent) and
    887           should be freed by MHD after processing the response has
    888           concluded (response reference counter reaches zero).
    889 
    890      'MHD_RESPMEM_MUST_COPY'
    891           Buffer is in transient memory, but not on the heap (for
    892           example, on the stack or non-malloc allocated) and only valid
    893           during the call to 'MHD_create_response_from_buffer'.  MHD
    894           must make its own private copy of the data for processing.
    895 
    896  -- Enumeration: MHD_ResponseFlags
    897      Response-specific flags.  Passed as an argument to
    898      'MHD_set_response_options()'.
    899 
    900      'MHD_RF_NONE'
    901           No special handling.
    902 
    903      'MHD_RF_HTTP_VERSION_1_0_ONLY'
    904           Only respond in conservative HTTP 1.0-mode.  In particular, do
    905           not (automatically) sent "Connection" headers and always close
    906           the connection after generating the response.
    907 
    908  -- Enumeration: MHD_ResponseOptions
    909      Response-specific options.  Passed in the varargs portion of
    910      'MHD_set_response_options()'.
    911 
    912      'MHD_RO_END'
    913           No more options / last option.  This is used to terminate the
    914           VARARGs list.
    915 
    916 
    917 File: libmicrohttpd.info,  Node: microhttpd-struct,  Next: microhttpd-cb,  Prev: microhttpd-const,  Up: Top
    918 
    919 3 Structures type definition
    920 ****************************
    921 
    922  -- C Struct: MHD_Daemon
    923      Handle for the daemon (listening on a socket for HTTP traffic).
    924 
    925  -- C Struct: MHD_Connection
    926      Handle for a connection / HTTP request.  With HTTP/1.1, multiple
    927      requests can be run over the same connection.  However, MHD will
    928      only show one request per TCP connection to the client at any given
    929      time.
    930 
    931  -- C Struct: MHD_Response
    932      Handle for a response.
    933 
    934  -- C Struct: MHD_PostProcessor
    935      Handle for 'POST' processing.
    936 
    937  -- C Union: MHD_ConnectionInfo
    938      Information about a connection.
    939 
    940  -- C Union: MHD_DaemonInfo
    941      Information about an MHD daemon.
    942 
    943 
    944 File: libmicrohttpd.info,  Node: microhttpd-cb,  Next: microhttpd-init,  Prev: microhttpd-struct,  Up: Top
    945 
    946 4 Callback functions definition
    947 *******************************
    948 
    949  -- Function Pointer: int *MHD_AcceptPolicyCallback (void *cls, const
    950           struct sockaddr * addr, socklen_t addrlen)
    951      Invoked in the context of a connection to allow or deny a client to
    952      connect.  This callback return 'MHD_YES' if connection is allowed,
    953      'MHD_NO' if not.
    954 
    955      CLS
    956           custom value selected at callback registration time;
    957      ADDR
    958           address information from the client;
    959      ADDRLEN
    960           length of the address information.
    961 
    962  -- Function Pointer: int *MHD_AccessHandlerCallback (void *cls, struct
    963           MHD_Connection * connection, const char *url, const char
    964           *method, const char *version, const char *upload_data, size_t
    965           *upload_data_size, void **con_cls)
    966      Invoked in the context of a connection to answer a request from the
    967      client.  This callback must call MHD functions (example: the
    968      'MHD_Response' ones) to provide content to give back to the client
    969      and return an HTTP status code (i.e.  '200' for OK, '404', etc.).
    970 
    971      *note microhttpd-post::, for details on how to code this callback.
    972 
    973      Must return 'MHD_YES' if the connection was handled successfully,
    974      'MHD_NO' if the socket must be closed due to a serious error while
    975      handling the request
    976 
    977      CLS
    978           custom value selected at callback registration time;
    979 
    980      URL
    981           the URL requested by the client;
    982 
    983      METHOD
    984           the HTTP method used by the client ('GET', 'PUT', 'DELETE',
    985           'POST', etc.);
    986 
    987      VERSION
    988           the HTTP version string (i.e.  'HTTP/1.1');
    989 
    990      UPLOAD_DATA
    991           the data being uploaded (excluding headers):
    992 
    993           'POST' data *will* be made available incrementally in
    994           UPLOAD_DATA; even if 'POST' data is available, the first time
    995           the callback is invoked there won't be upload data, as this is
    996           done just after MHD parses the headers.  If supported by the
    997           client and the HTTP version, the application can at this point
    998           queue an error response to possibly avoid the upload entirely.
    999           If no response is generated, MHD will (if required)
   1000           automatically send a 100 CONTINUE reply to the client.
   1001 
   1002           Afterwards, POST data will be passed to the callback to be
   1003           processed incrementally by the application.  The application
   1004           may return 'MHD_NO' to forcefully terminate the TCP connection
   1005           without generating a proper HTTP response.  Once all of the
   1006           upload data has been provided to the application, the
   1007           application will be called again with 0 bytes of upload data.
   1008           At this point, a response should be queued to complete the
   1009           handling of the request.
   1010 
   1011      UPLOAD_DATA_SIZE
   1012           set initially to the size of the UPLOAD_DATA provided; this
   1013           callback must update this value to the number of bytes *NOT*
   1014           processed; unless external select is used, the callback maybe
   1015           required to process at least some data.  If the callback fails
   1016           to process data in multi-threaded or internal-select mode and
   1017           if the read-buffer is already at the maximum size that MHD is
   1018           willing to use for reading (about half of the maximum amount
   1019           of memory allowed for the connection), then MHD will abort
   1020           handling the connection and return an internal server error to
   1021           the client.  In order to avoid this, clients must be able to
   1022           process upload data incrementally and reduce the value of
   1023           'upload_data_size'.
   1024 
   1025      CON_CLS
   1026           reference to a pointer, initially set to 'NULL', that this
   1027           callback can set to some address and that will be preserved by
   1028           MHD for future calls for this request;
   1029 
   1030           since the access handler may be called many times (i.e., for a
   1031           'PUT'/'POST' operation with plenty of upload data) this allows
   1032           the application to easily associate some request-specific
   1033           state;
   1034 
   1035           if necessary, this state can be cleaned up in the global
   1036           'MHD_RequestCompletedCallback' (which can be set with the
   1037           'MHD_OPTION_NOTIFY_COMPLETED').
   1038 
   1039  -- Function Pointer: void *MHD_RequestCompletedCallback (void *cls,
   1040           struct MHD_Connectionconnection, void **con_cls, enum
   1041           MHD_RequestTerminationCode toe)
   1042      Signature of the callback used by MHD to notify the application
   1043      about completed requests.
   1044 
   1045      CLS
   1046           custom value selected at callback registration time;
   1047 
   1048      CONNECTION
   1049           connection handle;
   1050 
   1051      CON_CLS
   1052           value as set by the last call to the
   1053           'MHD_AccessHandlerCallback';
   1054 
   1055      TOE
   1056           reason for request termination see
   1057           'MHD_OPTION_NOTIFY_COMPLETED'.
   1058 
   1059  -- Function Pointer: int *MHD_KeyValueIterator (void *cls, enum
   1060           MHD_ValueKind kind, const char *key, const char *value)
   1061      Iterator over key-value pairs.  This iterator can be used to
   1062      iterate over all of the cookies, headers, or 'POST'-data fields of
   1063      a request, and also to iterate over the headers that have been
   1064      added to a response.
   1065 
   1066      CLS
   1067           custom value specified when iteration was triggered;
   1068 
   1069      KIND
   1070           kind of the header we are looking at
   1071 
   1072      KEY
   1073           key for the value, can be an empty string
   1074 
   1075      VALUE
   1076           value corresponding value, can be NULL
   1077 
   1078      Return 'MHD_YES' to continue iterating, 'MHD_NO' to abort the
   1079      iteration.
   1080 
   1081  -- Function Pointer: int *MHD_ContentReaderCallback (void *cls,
   1082           uint64_t pos, char *buf, size_t max)
   1083      Callback used by MHD in order to obtain content.  The callback has
   1084      to copy at most MAX bytes of content into BUF.  The total number of
   1085      bytes that has been placed into BUF should be returned.
   1086 
   1087      Note that returning zero will cause MHD to try again.  Thus,
   1088      returning zero should only be used in conjunction with
   1089      'MHD_suspend_connection()' to avoid busy waiting.
   1090 
   1091      While usually the callback simply returns the number of bytes
   1092      written into BUF, there are two special return value:
   1093 
   1094      'MHD_CONTENT_READER_END_OF_STREAM' (-1) should be returned for the
   1095      regular end of transmission (with chunked encoding, MHD will then
   1096      terminate the chunk and send any HTTP footers that might be
   1097      present; without chunked encoding and given an unknown response
   1098      size, MHD will simply close the connection; note that while
   1099      returning 'MHD_CONTENT_READER_END_OF_STREAM' is not technically
   1100      legal if a response size was specified, MHD accepts this and treats
   1101      it just as 'MHD_CONTENT_READER_END_WITH_ERROR'.
   1102 
   1103      'MHD_CONTENT_READER_END_WITH_ERROR' (-2) is used to indicate a
   1104      server error generating the response; this will cause MHD to simply
   1105      close the connection immediately.  If a response size was given or
   1106      if chunked encoding is in use, this will indicate an error to the
   1107      client.  Note, however, that if the client does not know a response
   1108      size and chunked encoding is not in use, then clients will not be
   1109      able to tell the difference between
   1110      'MHD_CONTENT_READER_END_WITH_ERROR' and
   1111      'MHD_CONTENT_READER_END_OF_STREAM'.  This is not a limitation of
   1112      MHD but rather of the HTTP protocol.
   1113 
   1114      CLS
   1115           custom value selected at callback registration time;
   1116 
   1117      POS
   1118           position in the datastream to access; note that if an
   1119           'MHD_Response' object is re-used, it is possible for the same
   1120           content reader to be queried multiple times for the same data;
   1121           however, if an 'MHD_Response' is not re-used, MHD guarantees
   1122           that POS will be the sum of all non-negative return values
   1123           obtained from the content reader so far.
   1124 
   1125      Return '-1' on error (MHD will no longer try to read content and
   1126      instead close the connection with the client).
   1127 
   1128  -- Function Pointer: void *MHD_ContentReaderFreeCallback (void *cls)
   1129      This method is called by MHD if we are done with a content reader.
   1130      It should be used to free resources associated with the content
   1131      reader.
   1132 
   1133  -- Function Pointer: int *MHD_PostDataIterator (void *cls, enum
   1134           MHD_ValueKind kind, const char *key, const char *filename,
   1135           const char *content_type, const char *transfer_encoding, const
   1136           char *data, uint64_t off, size_t size)
   1137      Iterator over key-value pairs where the value maybe made available
   1138      in increments and/or may not be zero-terminated.  Used for
   1139      processing 'POST' data.
   1140 
   1141      CLS
   1142           custom value selected at callback registration time;
   1143 
   1144      KIND
   1145           type of the value;
   1146 
   1147      KEY
   1148           zero-terminated key for the value;
   1149 
   1150      FILENAME
   1151           name of the uploaded file, 'NULL' if not known;
   1152 
   1153      CONTENT_TYPE
   1154           mime-type of the data, 'NULL' if not known;
   1155 
   1156      TRANSFER_ENCODING
   1157           encoding of the data, 'NULL' if not known;
   1158 
   1159      DATA
   1160           pointer to size bytes of data at the specified offset;
   1161 
   1162      OFF
   1163           offset of data in the overall value;
   1164 
   1165      SIZE
   1166           number of bytes in data available.
   1167 
   1168      Return 'MHD_YES' to continue iterating, 'MHD_NO' to abort the
   1169      iteration.
   1170 
   1171 
   1172 File: libmicrohttpd.info,  Node: microhttpd-init,  Next: microhttpd-inspect,  Prev: microhttpd-cb,  Up: Top
   1173 
   1174 5 Starting and stopping the server
   1175 **********************************
   1176 
   1177  -- Function: void MHD_set_panic_func (MHD_PanicCallback cb, void *cls)
   1178      Set a handler for fatal errors.
   1179 
   1180      CB
   1181           function to call if MHD encounters a fatal internal error.  If
   1182           no handler was set explicitly, MHD will call 'abort'.
   1183 
   1184      CLS
   1185           closure argument for cb; the other arguments are the name of
   1186           the source file, line number and a string describing the
   1187           nature of the fatal error (which can be 'NULL')
   1188 
   1189  -- Function: struct MHD_Daemon * MHD_start_daemon (unsigned int flags,
   1190           unsigned short port, MHD_AcceptPolicyCallback apc, void
   1191           *apc_cls, MHD_AccessHandlerCallback dh, void *dh_cls, ...)
   1192      Start a webserver on the given port.
   1193 
   1194      FLAGS
   1195           OR-ed combination of 'MHD_FLAG' values;
   1196 
   1197      PORT
   1198           port to bind to;
   1199 
   1200      APC
   1201           callback to call to check which clients will be allowed to
   1202           connect; you can pass 'NULL' in which case connections from
   1203           any IP will be accepted;
   1204 
   1205      APC_CLS
   1206           extra argument to APC;
   1207 
   1208      DH
   1209           default handler for all URIs;
   1210 
   1211      DH_CLS
   1212           extra argument to DH.
   1213 
   1214      Additional arguments are a list of options (type-value pairs,
   1215      terminated with 'MHD_OPTION_END').  It is mandatory to use
   1216      'MHD_OPTION_END' as last argument, even when there are no
   1217      additional arguments.
   1218 
   1219      Return 'NULL' on error, handle to daemon on success.
   1220 
   1221  -- Function: int MHD_quiesce_daemon (struct MHD_Daemon *daemon)
   1222      Stop accepting connections from the listening socket.  Allows
   1223      clients to continue processing, but stops accepting new
   1224      connections.  Note that the caller is responsible for closing the
   1225      returned socket; however, if MHD is run using threads (anything but
   1226      external select mode), it must not be closed until AFTER
   1227      'MHD_stop_daemon' has been called (as it is theoretically possible
   1228      that an existing thread is still using it).
   1229 
   1230      This function is useful in the special case that a listen socket is
   1231      to be migrated to another process (i.e.  a newer version of the
   1232      HTTP server) while existing connections should continue to be
   1233      processed until they are finished.
   1234 
   1235      Return '-1' on error (daemon not listening), the handle to the
   1236      listen socket otherwise.
   1237 
   1238  -- Function: void MHD_stop_daemon (struct MHD_Daemon *daemon)
   1239      Shutdown an HTTP daemon.
   1240 
   1241  -- Function: int MHD_run (struct MHD_Daemon *daemon)
   1242      Run webserver operations (without blocking unless in client
   1243      callbacks).  This method should be called by clients in combination
   1244      with 'MHD_get_fdset()' if the client-controlled 'select'-method is
   1245      used.
   1246 
   1247      This function will work for external 'poll' and 'select' mode.
   1248      However, if using external 'select' mode, you may want to instead
   1249      use 'MHD_run_from_select', as it is more efficient.
   1250 
   1251      DAEMON
   1252           daemon to process connections of
   1253 
   1254      Return 'MHD_YES' on success, 'MHD_NO' if this daemon was not
   1255      started with the right options for this call.
   1256 
   1257  -- Function: int MHD_run_from_select (struct MHD_Daemon *daemon, const
   1258           fd_set *read_fd_set, const fd_set *write_fd_set, const fd_set
   1259           *except_fd_set)
   1260      Run webserver operations given sets of ready socket handles.
   1261 
   1262      This method should be called by clients in combination with
   1263      'MHD_get_fdset' if the client-controlled (external) select method
   1264      is used.
   1265 
   1266      You can use this function instead of 'MHD_run' if you called
   1267      'select' on the result from 'MHD_get_fdset'.  File descriptors in
   1268      the sets that are not controlled by MHD will be ignored.  Calling
   1269      this function instead of 'MHD_run' is more efficient as MHD will
   1270      not have to call 'select' again to determine which operations are
   1271      ready.
   1272 
   1273      DAEMON
   1274           daemon to process connections of
   1275      READ_FD_SET
   1276           set of descriptors that must be ready for reading without
   1277           blocking
   1278      WRITE_FD_SET
   1279           set of descriptors that must be ready for writing without
   1280           blocking
   1281      EXCEPT_FD_SET
   1282           ignored, can be NULL
   1283 
   1284      Return 'MHD_YES' on success, 'MHD_NO' on serious internal errors.
   1285 
   1286  -- Function: void MHD_add_connection (struct MHD_Daemon *daemon, int
   1287           client_socket, const struct sockaddr *addr, socklen_t addrlen)
   1288      Add another client connection to the set of connections managed by
   1289      MHD. This API is usually not needed (since MHD will accept inbound
   1290      connections on the server socket).  Use this API in special cases,
   1291      for example if your HTTP server is behind NAT and needs to connect
   1292      out to the HTTP client, or if you are building a proxy.
   1293 
   1294      If you use this API in conjunction with a internal select or a
   1295      thread pool, you must set the option 'MHD_USE_PIPE_FOR_SHUTDOWN' to
   1296      ensure that the freshly added connection is immediately processed
   1297      by MHD.
   1298 
   1299      The given client socket will be managed (and closed!)  by MHD after
   1300      this call and must no longer be used directly by the application
   1301      afterwards.
   1302 
   1303      DAEMON
   1304           daemon that manages the connection
   1305      CLIENT_SOCKET
   1306           socket to manage (MHD will expect to receive an HTTP request
   1307           from this socket next).
   1308      ADDR
   1309           IP address of the client
   1310      ADDRLEN
   1311           number of bytes in addr
   1312 
   1313      This function will return 'MHD_YES' on success, 'MHD_NO' if this
   1314      daemon could not handle the connection (i.e.  malloc failed, etc).
   1315      The socket will be closed in any case; 'errno' is set to indicate
   1316      further details about the error.
   1317 
   1318 
   1319 File: libmicrohttpd.info,  Node: microhttpd-inspect,  Next: microhttpd-requests,  Prev: microhttpd-init,  Up: Top
   1320 
   1321 6 Implementing external 'select'
   1322 ********************************
   1323 
   1324  -- Function: int MHD_get_fdset (struct MHD_Daemon *daemon, fd_set *
   1325           read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set,
   1326           int *max_fd)
   1327      Obtain the 'select()' sets for this daemon.  The daemon's socket is
   1328      added to READ_FD_SET.  The list of currently existent connections
   1329      is scanned and their file descriptors added to the correct set.
   1330 
   1331      After the call completed successfully: the variable referenced by
   1332      MAX_FD references the file descriptor with highest integer
   1333      identifier.  The variable must be set to zero before invoking this
   1334      function.
   1335 
   1336      Return 'MHD_YES' on success, 'MHD_NO' if: the arguments are invalid
   1337      (example: 'NULL' pointers); this daemon was not started with the
   1338      right options for this call.
   1339 
   1340  -- Function: int MHD_get_timeout (struct MHD_Daemon *daemon, unsigned
   1341           long long *timeout)
   1342      Obtain timeout value for select for this daemon (only needed if
   1343      connection timeout is used).  The returned value is how many
   1344      milliseconds 'select' should at most block, not the timeout value
   1345      set for connections.  This function must not be called if the
   1346      'MHD_USE_THREAD_PER_CONNECTION' mode is in use (since then it is
   1347      not meaningful to ask for a timeout, after all, there is
   1348      concurrenct activity).  The function must also not be called by
   1349      user-code if 'MHD_USE_INTERNAL_SELECT' is in use.  In the latter
   1350      case, the behavior is undefined.
   1351 
   1352      DAEMON
   1353           which daemon to obtain the timeout from.
   1354      TIMEOUT
   1355           will be set to the timeout (in milliseconds).
   1356 
   1357      Return 'MHD_YES' on success, 'MHD_NO' if timeouts are not used (or
   1358      no connections exist that would necessiate the use of a timeout
   1359      right now).
   1360 
   1361 
   1362 File: libmicrohttpd.info,  Node: microhttpd-requests,  Next: microhttpd-responses,  Prev: microhttpd-inspect,  Up: Top
   1363 
   1364 7 Handling requests
   1365 *******************
   1366 
   1367  -- Function: int MHD_get_connection_values (struct MHD_Connection
   1368           *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator
   1369           iterator, void *iterator_cls)
   1370      Get all the headers matching KIND from the request.
   1371 
   1372      The ITERATOR callback is invoked once for each header, with
   1373      ITERATOR_CLS as first argument.  After version 0.9.19, the headers
   1374      are iterated in the same order as they were received from the
   1375      network; previous versions iterated over the headers in reverse
   1376      order.
   1377 
   1378      'MHD_get_connection_values' returns the number of entries iterated
   1379      over; this can be less than the number of headers if, while
   1380      iterating, ITERATOR returns 'MHD_NO'.
   1381 
   1382      ITERATOR can be 'NULL': in this case this function just counts and
   1383      returns the number of headers.
   1384 
   1385      In the case of 'MHD_GET_ARGUMENT_KIND', the VALUE argument will be
   1386      'NULL' if the URL contained a key without an equals operator.  For
   1387      example, for a HTTP request to the URL "http://foo/bar?key", the
   1388      VALUE argument is 'NULL'; in contrast, a HTTP request to the URL
   1389      "http://foo/bar?key=", the VALUE argument is the empty string.  The
   1390      normal case is that the URL contains "http://foo/bar?key=value" in
   1391      which case VALUE would be the string "value" and KEY would contain
   1392      the string "key".
   1393 
   1394  -- Function: int MHD_set_connection_value (struct MHD_Connection
   1395           *connection, enum MHD_ValueKind kind, const char * key, const
   1396           char * value)
   1397      This function can be used to append an entry to the list of HTTP
   1398      headers of a connection (so that the 'MHD_get_connection_values
   1399      function' will return them - and the MHD PostProcessor will also
   1400      see them).  This maybe required in certain situations (see Mantis
   1401      #1399) where (broken) HTTP implementations fail to supply values
   1402      needed by the post processor (or other parts of the application).
   1403 
   1404      This function MUST only be called from within the
   1405      MHD_AccessHandlerCallback (otherwise, access maybe improperly
   1406      synchronized).  Furthermore, the client must guarantee that the key
   1407      and value arguments are 0-terminated strings that are NOT freed
   1408      until the connection is closed.  (The easiest way to do this is by
   1409      passing only arguments to permanently allocated strings.).
   1410 
   1411      CONNECTION is the connection for which the entry for KEY of the
   1412      given KIND should be set to the given VALUE.
   1413 
   1414      The function returns 'MHD_NO' if the operation could not be
   1415      performed due to insufficient memory and 'MHD_YES' on success.
   1416 
   1417  -- Function: const char * MHD_lookup_connection_value (struct
   1418           MHD_Connection *connection, enum MHD_ValueKind kind, const
   1419           char *key)
   1420      Get a particular header value.  If multiple values match the KIND,
   1421      return one of them (the "first", whatever that means).  KEY must
   1422      reference a zero-terminated ASCII-coded string representing the
   1423      header to look for: it is compared against the headers using
   1424      'strcasecmp()', so case is ignored.  A value of 'NULL' for KEY can
   1425      be used to lookup 'trailing' values without a key, for example if a
   1426      URI is of the form "http://example.com/?trailer", a KEY of 'NULL'
   1427      can be used to access "tailer" The function returns 'NULL' if no
   1428      matching item was found.
   1429 
   1430 
   1431 File: libmicrohttpd.info,  Node: microhttpd-responses,  Next: microhttpd-flow,  Prev: microhttpd-requests,  Up: Top
   1432 
   1433 8 Building responses to requests
   1434 ********************************
   1435 
   1436 Response objects handling by MHD is asynchronous with respect to the
   1437 application execution flow.  Instances of the 'MHD_Response' structure
   1438 are not associated to a daemon and neither to a client connection: they
   1439 are managed with reference counting.
   1440 
   1441    In the simplest case: we allocate a new 'MHD_Response' structure for
   1442 each response, we use it once and finally we destroy it.
   1443 
   1444    MHD allows more efficient resources usages.
   1445 
   1446    Example: we allocate a new 'MHD_Response' structure for each response
   1447 *kind*, we use it every time we have to give that response and we
   1448 finally destroy it only when the daemon shuts down.
   1449 
   1450 * Menu:
   1451 
   1452 * microhttpd-response enqueue:: Enqueuing a response.
   1453 * microhttpd-response create::  Creating a response object.
   1454 * microhttpd-response headers:: Adding headers to a response.
   1455 * microhttpd-response options:: Setting response options.
   1456 * microhttpd-response inspect:: Inspecting a response object.
   1457 
   1458 
   1459 File: libmicrohttpd.info,  Node: microhttpd-response enqueue,  Next: microhttpd-response create,  Up: microhttpd-responses
   1460 
   1461 8.1 Enqueuing a response
   1462 ========================
   1463 
   1464  -- Function: int MHD_queue_response (struct MHD_Connection *connection,
   1465           unsigned int status_code, struct MHD_Response *response)
   1466      Queue a response to be transmitted to the client as soon as
   1467      possible but only after MHD_AccessHandlerCallback returns.  This
   1468      function checks that it is legal to queue a response at this time
   1469      for the given connection.  It also increments the internal
   1470      reference counter for the response object (the counter will be
   1471      decremented automatically once the response has been transmitted).
   1472 
   1473      CONNECTION
   1474           the connection identifying the client;
   1475 
   1476      STATUS_CODE
   1477           HTTP status code (i.e.  '200' for OK);
   1478 
   1479      RESPONSE
   1480           response to transmit.
   1481 
   1482      Return 'MHD_YES' on success or if message has been queued.  Return
   1483      'MHD_NO': if arguments are invalid (example: 'NULL' pointer); on
   1484      error (i.e.  reply already sent).
   1485 
   1486  -- Function: void MHD_destroy_response (struct MHD_Response *response)
   1487      Destroy a response object and associated resources (decrement the
   1488      reference counter).  Note that MHD may keep some of the resources
   1489      around if the response is still in the queue for some clients, so
   1490      the memory may not necessarily be freed immediately.
   1491 
   1492    An explanation of reference counting(1):
   1493 
   1494   1. a 'MHD_Response' object is allocated:
   1495 
   1496           struct MHD_Response * response = MHD_create_response_from_buffer(...);
   1497           /* here: reference counter = 1 */
   1498 
   1499   2. the 'MHD_Response' object is enqueued in a 'MHD_Connection':
   1500 
   1501           MHD_queue_response(connection, , response);
   1502           /* here: reference counter = 2 */
   1503 
   1504   3. the creator of the response object discharges responsibility for
   1505      it:
   1506 
   1507           MHD_destroy_response(response);
   1508           /* here: reference counter = 1 */
   1509 
   1510   4. the daemon handles the connection sending the response's data to
   1511      the client then decrements the reference counter by calling
   1512      'MHD_destroy_response()': the counter's value drops to zero and the
   1513      'MHD_Response' object is released.
   1514 
   1515    ---------- Footnotes ----------
   1516 
   1517    (1) Note to readers acquainted to the Tcl API: reference counting on
   1518 'MHD_Connection' structures is handled in the same way as Tcl handles
   1519 'Tcl_Obj' structures through 'Tcl_IncrRefCount()' and
   1520 'Tcl_DecrRefCount()'.
   1521 
   1522 
   1523 File: libmicrohttpd.info,  Node: microhttpd-response create,  Next: microhttpd-response headers,  Prev: microhttpd-response enqueue,  Up: microhttpd-responses
   1524 
   1525 8.2 Creating a response object
   1526 ==============================
   1527 
   1528  -- Function: struct MHD_Response * MHD_create_response_from_callback
   1529           (uint64_t size, size_t block_size, MHD_ContentReaderCallback
   1530           crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc)
   1531      Create a response object.  The response object can be extended with
   1532      header information and then it can be used any number of times.
   1533 
   1534      SIZE
   1535           size of the data portion of the response, '-1' for unknown;
   1536 
   1537      BLOCK_SIZE
   1538           preferred block size for querying CRC (advisory only, MHD may
   1539           still call CRC using smaller chunks); this is essentially the
   1540           buffer size used for IO, clients should pick a value that is
   1541           appropriate for IO and memory performance requirements;
   1542 
   1543      CRC
   1544           callback to use to obtain response data;
   1545 
   1546      CRC_CLS
   1547           extra argument to CRC;
   1548 
   1549      CRFC
   1550           callback to call to free CRC_CLS resources.
   1551 
   1552      Return 'NULL' on error (i.e.  invalid arguments, out of memory).
   1553 
   1554  -- Function: struct MHD_Response * MHD_create_response_from_fd
   1555           (uint64_t size, int fd)
   1556      Create a response object.  The response object can be extended with
   1557      header information and then it can be used any number of times.
   1558 
   1559      SIZE
   1560           size of the data portion of the response (should be smaller or
   1561           equal to the size of the file)
   1562 
   1563      FD
   1564           file descriptor referring to a file on disk with the data;
   1565           will be closed when response is destroyed; note that 'fd' must
   1566           be an actual file descriptor (not a pipe or socket) since MHD
   1567           might use 'sendfile' or 'seek' on it.  The descriptor should
   1568           be in blocking-IO mode.
   1569 
   1570      Return 'NULL' on error (i.e.  invalid arguments, out of memory).
   1571 
   1572  -- Function: struct MHD_Response *
   1573           MHD_create_response_from_fd_at_offset (size_t size, int fd,
   1574           off_t offset)
   1575      Create a response object.  The response object can be extended with
   1576      header information and then it can be used any number of times.
   1577      Note that you need to be a bit careful about 'off_t' when writing
   1578      this code.  Depending on your platform, MHD is likely to have been
   1579      compiled with support for 64-bit files.  When you compile your own
   1580      application, you must make sure that 'off_t' is also a 64-bit
   1581      value.  If not, your compiler may pass a 32-bit value as 'off_t',
   1582      which will result in 32-bits of garbage.
   1583 
   1584      If you use the autotools, use the 'AC_SYS_LARGEFILE' autoconf macro
   1585      and make sure to include the generated 'config.h' file before
   1586      'microhttpd.h' to avoid problems.  If you do not have a build
   1587      system and only want to run on a GNU/Linux system, you could also
   1588      use
   1589      #define _FILE_OFFSET_BITS 64
   1590      #include <sys/types.h>
   1591      #include <sys/stat.h>
   1592      #include <fcntl.h>
   1593      #include <microhttpd.h>
   1594      to ensure 64-bit 'off_t'.  Note that if your operating system does
   1595      not support 64-bit files, MHD will be compiled with a 32-bit
   1596      'off_t' (in which case the above would be wrong).
   1597 
   1598      SIZE
   1599           size of the data portion of the response (number of bytes to
   1600           transmit from the file starting at offset).
   1601 
   1602      FD
   1603           file descriptor referring to a file on disk with the data;
   1604           will be closed when response is destroyed; note that 'fd' must
   1605           be an actual file descriptor (not a pipe or socket) since MHD
   1606           might use 'sendfile' or 'seek' on it.  The descriptor should
   1607           be in blocking-IO mode.
   1608 
   1609      OFFSET
   1610           offset to start reading from in the file
   1611 
   1612      Return 'NULL' on error (i.e.  invalid arguments, out of memory).
   1613 
   1614  -- Function: struct MHD_Response * MHD_create_response_from_buffer
   1615           (size_t size, void *data, enum MHD_ResponseMemoryMode mode)
   1616      Create a response object.  The response object can be extended with
   1617      header information and then it can be used any number of times.
   1618 
   1619      SIZE
   1620           size of the data portion of the response;
   1621 
   1622      BUFFER
   1623           the data itself;
   1624 
   1625      MODE
   1626           memory management options for buffer; use
   1627           MHD_RESPMEM_PERSISTENT if the buffer is static/global memory,
   1628           use MHD_RESPMEM_MUST_FREE if the buffer is heap-allocated and
   1629           should be freed by MHD and MHD_RESPMEM_MUST_COPY if the buffer
   1630           is in transient memory (i.e.  on the stack) and must be copied
   1631           by MHD;
   1632 
   1633      Return 'NULL' on error (i.e.  invalid arguments, out of memory).
   1634 
   1635  -- Function: struct MHD_Response * MHD_create_response_from_data
   1636           (size_t size, void *data, int must_free, int must_copy)
   1637      Create a response object.  The response object can be extended with
   1638      header information and then it can be used any number of times.
   1639      This function is deprecated, use 'MHD_create_response_from_buffer'
   1640      instead.
   1641 
   1642      SIZE
   1643           size of the data portion of the response;
   1644 
   1645      DATA
   1646           the data itself;
   1647 
   1648      MUST_FREE
   1649           if true: MHD should free data when done;
   1650 
   1651      MUST_COPY
   1652           if true: MHD allocates a block of memory and use it to make a
   1653           copy of DATA embedded in the returned 'MHD_Response'
   1654           structure; handling of the embedded memory is responsibility
   1655           of MHD; DATA can be released anytime after this call returns.
   1656 
   1657      Return 'NULL' on error (i.e.  invalid arguments, out of memory).
   1658 
   1659    Example: create a response from a statically allocated string:
   1660 
   1661      const char * data = "<html><body><p>Error!</p></body></html>";
   1662 
   1663      struct MHD_Connection * connection = ...;
   1664      struct MHD_Response *   response;
   1665 
   1666      response = MHD_create_response_from_buffer (strlen(data), data,
   1667                                                  MHD_RESPMEM_PERSISTENT);
   1668      MHD_queue_response(connection, 404, response);
   1669      MHD_destroy_response(response);
   1670 
   1671 
   1672 File: libmicrohttpd.info,  Node: microhttpd-response headers,  Next: microhttpd-response options,  Prev: microhttpd-response create,  Up: microhttpd-responses
   1673 
   1674 8.3 Adding headers to a response
   1675 ================================
   1676 
   1677  -- Function: int MHD_add_response_header (struct MHD_Response
   1678           *response, const char *header, const char *content)
   1679      Add a header line to the response.  The strings referenced by
   1680      HEADER and CONTENT must be zero-terminated and they are duplicated
   1681      into memory blocks embedded in RESPONSE.
   1682 
   1683      Notice that the strings must not hold newlines, carriage returns or
   1684      tab chars.
   1685 
   1686      Return 'MHD_NO' on error (i.e.  invalid header or content format or
   1687      memory allocation error).
   1688 
   1689  -- Function: int MHD_add_response_footer (struct MHD_Response
   1690           *response, const char *footer, const char *content)
   1691      Add a footer line to the response.  The strings referenced by
   1692      FOOTER and CONTENT must be zero-terminated and they are duplicated
   1693      into memory blocks embedded in RESPONSE.
   1694 
   1695      Notice that the strings must not hold newlines, carriage returns or
   1696      tab chars.  You can add response footers at any time before
   1697      signalling the end of the response to MHD (not just before calling
   1698      'MHD_queue_response').  Footers are useful for adding cryptographic
   1699      checksums to the reply or to signal errors encountered during data
   1700      generation.  This call was introduced in MHD 0.9.3.
   1701 
   1702      Return 'MHD_NO' on error (i.e.  invalid header or content format or
   1703      memory allocation error).
   1704 
   1705  -- Function: int MHD_del_response_header (struct MHD_Response
   1706           *response, const char *header, const char *content)
   1707      Delete a header (or footer) line from the response.  Return
   1708      'MHD_NO' on error (arguments are invalid or no such header known).
   1709 
   1710 
   1711 File: libmicrohttpd.info,  Node: microhttpd-response options,  Next: microhttpd-response inspect,  Prev: microhttpd-response headers,  Up: microhttpd-responses
   1712 
   1713 8.4 Setting response options
   1714 ============================
   1715 
   1716  -- Function: int MHD_set_response_options (struct MHD_Response
   1717           *response, enum MHD_ResponseFlags flags, ...)
   1718      Set special flags and options for a response.
   1719 
   1720      Calling this functions sets the given flags and options for the
   1721      response.
   1722 
   1723      RESPONSE
   1724           which response should be modified;
   1725 
   1726      FLAGS
   1727           flags to set for the response;
   1728 
   1729      Additional arguments are a list of options (type-value pairs,
   1730      terminated with 'MHD_RO_END').  It is mandatory to use 'MHD_RO_END'
   1731      as last argument, even when there are no additional arguments.
   1732 
   1733      Return 'MHD_NO' on error, 'MHD_YES' on success.
   1734 
   1735 
   1736 File: libmicrohttpd.info,  Node: microhttpd-response inspect,  Prev: microhttpd-response options,  Up: microhttpd-responses
   1737 
   1738 8.5 Inspecting a response object
   1739 ================================
   1740 
   1741  -- Function: int MHD_get_response_headers (struct MHD_Response
   1742           *response, MHD_KeyValueIterator iterator, void *iterator_cls)
   1743      Get all of the headers added to a response.
   1744 
   1745      Invoke the ITERATOR callback for each header in the response, using
   1746      ITERATOR_CLS as first argument.  Return number of entries iterated
   1747      over.  ITERATOR can be 'NULL': in this case the function just
   1748      counts headers.
   1749 
   1750      ITERATOR should not modify the its key and value arguments, unless
   1751      we know what we are doing.
   1752 
   1753  -- Function: const char * MHD_get_response_header (struct MHD_Response
   1754           *response, const char *key)
   1755      Find and return a pointer to the value of a particular header from
   1756      the response.  KEY must reference a zero-terminated string
   1757      representing the header to look for.  The search is case sensitive.
   1758      Return 'NULL' if header does not exist or KEY is 'NULL'.
   1759 
   1760      We should not modify the value, unless we know what we are doing.
   1761 
   1762 
   1763 File: libmicrohttpd.info,  Node: microhttpd-flow,  Next: microhttpd-dauth,  Prev: microhttpd-responses,  Up: Top
   1764 
   1765 9 Flow control.
   1766 ***************
   1767 
   1768 Sometimes it may be possible that clients upload data faster than an
   1769 application can process it, or that an application needs an extended
   1770 period of time to generate a response.  If
   1771 'MHD_USE_THREAD_PER_CONNECTION' is used, applications can simply deal
   1772 with this by performing their logic within the thread and thus
   1773 effectively blocking connection processing by MHD. In all other modes,
   1774 blocking logic must not be placed within the callbacks invoked by MHD as
   1775 this would also block processing of other requests, as a single thread
   1776 may be responsible for tens of thousands of connections.
   1777 
   1778    Instead, applications using thread modes other than
   1779 'MHD_USE_THREAD_PER_CONNECTION' should use the following functions to
   1780 perform flow control.
   1781 
   1782  -- Function: int MHD_suspend_connection (struct MHD_Connection
   1783           *connection)
   1784      Suspend handling of network data for a given connection.  This can
   1785      be used to dequeue a connection from MHD's event loop (external
   1786      select, internal select or thread pool; not applicable to
   1787      thread-per-connection!)  for a while.
   1788 
   1789      If you use this API in conjunction with a internal select or a
   1790      thread pool, you must set the option 'MHD_USE_SUSPEND_RESUME' to
   1791      ensure that a resumed connection is immediately processed by MHD.
   1792 
   1793      Suspended connections continue to count against the total number of
   1794      connections allowed (per daemon, as well as per IP, if such limits
   1795      are set).  Suspended connections will NOT time out; timeouts will
   1796      restart when the connection handling is resumed.  While a
   1797      connection is suspended, MHD will not detect disconnects by the
   1798      client.
   1799 
   1800      The only safe time to suspend a connection is from the
   1801      'MHD_AccessHandlerCallback'.
   1802 
   1803      Finally, it is an API violation to call 'MHD_stop_daemon' while
   1804      having suspended connections (this will at least create memory and
   1805      socket leaks or lead to undefined behavior).  You must explicitly
   1806      resume all connections before stopping the daemon.
   1807 
   1808      CONNECTION
   1809           the connection to suspend
   1810 
   1811  -- Function: int MHD_resume_connection (struct MHD_Connection
   1812           *connection)
   1813      Resume handling of network data for suspended connection.  It is
   1814      safe to resume a suspended connection at any time.  Calling this
   1815      function on a connection that was not previously suspended will
   1816      result in undefined behavior.
   1817 
   1818      CONNECTION
   1819           the connection to resume
   1820 
   1821 
   1822 File: libmicrohttpd.info,  Node: microhttpd-dauth,  Next: microhttpd-post,  Prev: microhttpd-flow,  Up: Top
   1823 
   1824 10 Utilizing Authentication
   1825 ***************************
   1826 
   1827 MHD support three types of client authentication.
   1828 
   1829    Basic authentication uses a simple authentication method based on
   1830 BASE64 algorithm.  Username and password are exchanged in clear between
   1831 the client and the server, so this method must only be used for
   1832 non-sensitive content or when the session is protected with https.  When
   1833 using basic authentication MHD will have access to the clear password,
   1834 possibly allowing to create a chained authentication toward an external
   1835 authentication server.
   1836 
   1837    Digest authentication uses a one-way authentication method based on
   1838 MD5 hash algorithm.  Only the hash will transit over the network, hence
   1839 protecting the user password.  The nonce will prevent replay attacks.
   1840 This method is appropriate for general use, especially when https is not
   1841 used to encrypt the session.
   1842 
   1843    Client certificate authentication uses a X.509 certificate from the
   1844 client.  This is the strongest authentication mechanism but it requires
   1845 the use of HTTPS. Client certificate authentication can be used
   1846 simultaneously with Basic or Digest Authentication in order to provide a
   1847 two levels authentication (like for instance separate machine and user
   1848 authentication).  A code example for using client certificates is
   1849 presented in the MHD tutorial.
   1850 
   1851 * Menu:
   1852 
   1853 * microhttpd-dauth basic:: Using Basic Authentication.
   1854 * microhttpd-dauth digest:: Using Digest Authentication.
   1855 
   1856 
   1857 File: libmicrohttpd.info,  Node: microhttpd-dauth basic,  Next: microhttpd-dauth digest,  Up: microhttpd-dauth
   1858 
   1859 10.1 Using Basic Authentication
   1860 ===============================
   1861 
   1862  -- Function: char * MHD_basic_auth_get_username_password (struct
   1863           MHD_Connection *connection, char** password)
   1864      Get the username and password from the basic authorization header
   1865      sent by the client.  Return 'NULL' if no username could be found, a
   1866      pointer to the username if found.  If returned value is not 'NULL',
   1867      the value must be 'free()''ed.
   1868 
   1869      PASSWORD reference a buffer to store the password.  It can be
   1870      'NULL'.  If returned value is not 'NULL', the value must be
   1871      'free()''ed.
   1872 
   1873  -- Function: int MHD_queue_basic_auth_fail_response (struct
   1874           MHD_Connection *connection, const char *realm, struct
   1875           MHD_Response *response)
   1876      Queues a response to request basic authentication from the client.
   1877      Return 'MHD_YES' if successful, otherwise 'MHD_NO'.
   1878 
   1879      REALM must reference to a zero-terminated string representing the
   1880      realm.
   1881 
   1882      RESPONSE a response structure to specify what shall be presented to
   1883      the client with a 401 HTTP status.
   1884 
   1885 
   1886 File: libmicrohttpd.info,  Node: microhttpd-dauth digest,  Prev: microhttpd-dauth basic,  Up: microhttpd-dauth
   1887 
   1888 10.2 Using Digest Authentication
   1889 ================================
   1890 
   1891  -- Function: char * MHD_digest_auth_get_username (struct MHD_Connection
   1892           *connection)
   1893      Find and return a pointer to the username value from the request
   1894      header.  Return 'NULL' if the value is not found or header does not
   1895      exist.  If returned value is not 'NULL', the value must be
   1896      'free()''ed.
   1897 
   1898  -- Function: int MHD_digest_auth_check (struct MHD_Connection
   1899           *connection, const char *realm, const char *username, const
   1900           char *password, unsigned int nonce_timeout)
   1901      Checks if the provided values in the WWW-Authenticate header are
   1902      valid and sound according to RFC2716.  If valid return 'MHD_YES',
   1903      otherwise return 'MHD_NO'.
   1904 
   1905      REALM must reference to a zero-terminated string representing the
   1906      realm.
   1907 
   1908      USERNAME must reference to a zero-terminated string representing
   1909      the username, it is usually the returned value from
   1910      MHD_digest_auth_get_username.
   1911 
   1912      PASSWORD must reference to a zero-terminated string representing
   1913      the password, most probably it will be the result of a lookup of
   1914      the username against a local database.
   1915 
   1916      NONCE_TIMEOUT is the amount of time in seconds for a nonce to be
   1917      invalid.  Most of the time it is sound to specify 300 seconds as
   1918      its values.
   1919 
   1920  -- Function: int MHD_queue_auth_fail_response (struct MHD_Connection
   1921           *connection, const char *realm, const char *opaque, struct
   1922           MHD_Response *response, int signal_stale)
   1923      Queues a response to request authentication from the client, return
   1924      'MHD_YES' if successful, otherwise 'MHD_NO'.
   1925 
   1926      REALM must reference to a zero-terminated string representing the
   1927      realm.
   1928 
   1929      OPAQUE must reference to a zero-terminated string representing a
   1930      value that gets passed to the client and expected to be passed
   1931      again to the server as-is.  This value can be a hexadecimal or
   1932      base64 string.
   1933 
   1934      RESPONSE a response structure to specify what shall be presented to
   1935      the client with a 401 HTTP status.
   1936 
   1937      SIGNAL_STALE a value that signals "stale=true" in the response
   1938      header to indicate the invalidity of the nonce and no need to ask
   1939      for authentication parameters and only a new nonce gets generated.
   1940      'MHD_YES' to generate a new nonce, 'MHD_NO' to ask for
   1941      authentication parameters.
   1942 
   1943    Example: handling digest authentication requests and responses.
   1944 
   1945      #define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access granted</body></html>"
   1946      #define DENIED "<html><head><title>libmicrohttpd demo</title></head><body>Access denied</body></html>"
   1947      #define OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"
   1948 
   1949      static int
   1950      ahc_echo (void *cls,
   1951                struct MHD_Connection *connection,
   1952                const char *url,
   1953                const char *method,
   1954                const char *version,
   1955                const char *upload_data, size_t *upload_data_size, void **ptr)
   1956      {
   1957        struct MHD_Response *response;
   1958        char *username;
   1959        const char *password = "testpass";
   1960        const char *realm = "test (a] example.com";
   1961        int ret;
   1962 
   1963        username = MHD_digest_auth_get_username(connection);
   1964        if (username == NULL)
   1965          {
   1966            response = MHD_create_response_from_buffer(strlen (DENIED),
   1967      					         DENIED,
   1968      					         MHD_RESPMEM_PERSISTENT);
   1969            ret = MHD_queue_auth_fail_response(connection, realm,
   1970      					 OPAQUE,
   1971      					 response,
   1972      					 MHD_NO);
   1973            MHD_destroy_response(response);
   1974            return ret;
   1975          }
   1976        ret = MHD_digest_auth_check(connection, realm,
   1977      			      username,
   1978      			      password,
   1979      			      300);
   1980        free(username);
   1981        if ( (ret == MHD_INVALID_NONCE) ||
   1982             (ret == MHD_NO) )
   1983          {
   1984            response = MHD_create_response_from_buffer(strlen (DENIED),
   1985      					         DENIED,
   1986      					         MHD_RESPMEM_PERSISTENT);
   1987            if (NULL == response)
   1988      	return MHD_NO;
   1989            ret = MHD_queue_auth_fail_response(connection, realm,
   1990      					 OPAQUE,
   1991      					 response,
   1992      					 (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO);
   1993            MHD_destroy_response(response);
   1994            return ret;
   1995          }
   1996        response = MHD_create_response_from_buffer (strlen(PAGE), PAGE,
   1997       					      MHD_RESPMEM_PERSISTENT);
   1998        ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
   1999        MHD_destroy_response(response);
   2000        return ret;
   2001      }
   2002 
   2003 
   2004 File: libmicrohttpd.info,  Node: microhttpd-post,  Next: microhttpd-info,  Prev: microhttpd-dauth,  Up: Top
   2005 
   2006 11 Adding a 'POST' processor
   2007 ****************************
   2008 
   2009 * Menu:
   2010 
   2011 * microhttpd-post api::         Programming interface for the
   2012                                 'POST' processor.
   2013 
   2014 MHD provides the post processor API to make it easier for applications
   2015 to parse the data of a client's 'POST' request: the
   2016 'MHD_AccessHandlerCallback' will be invoked multiple times to process
   2017 data as it arrives; at each invocation a new chunk of data must be
   2018 processed.  The arguments UPLOAD_DATA and UPLOAD_DATA_SIZE are used to
   2019 reference the chunk of data.
   2020 
   2021    When 'MHD_AccessHandlerCallback' is invoked for a new connection: its
   2022 '*CON_CLS' argument is set to 'NULL'.  When 'POST' data comes in the
   2023 upload buffer it is *mandatory* to use the CON_CLS to store a reference
   2024 to per-connection data.  The fact that the pointer was initially 'NULL'
   2025 can be used to detect that this is a new request.
   2026 
   2027    One method to detect that a new connection was established is to set
   2028 '*con_cls' to an unused integer:
   2029 
   2030      int
   2031      access_handler (void *cls,
   2032                      struct MHD_Connection * connection,
   2033                      const char *url,
   2034                      const char *method, const char *version,
   2035                      const char *upload_data, size_t *upload_data_size,
   2036                      void **con_cls)
   2037      {
   2038        static int old_connection_marker;
   2039        int new_connection = (NULL == *con_cls);
   2040 
   2041        if (new_connection)
   2042          {
   2043            /* new connection with POST */
   2044            *con_cls = &old_connection_marker;
   2045          }
   2046 
   2047        ...
   2048      }
   2049 
   2050 In contrast to the previous example, for 'POST' requests in particular,
   2051 it is more common to use the value of '*con_cls' to keep track of actual
   2052 state used during processing, such as the post processor (or a struct
   2053 containing a post processor):
   2054 
   2055      int
   2056      access_handler (void *cls,
   2057                      struct MHD_Connection * connection,
   2058                      const char *url,
   2059                      const char *method, const char *version,
   2060                      const char *upload_data, size_t *upload_data_size,
   2061                      void **con_cls)
   2062      {
   2063        struct MHD_PostProcessor * pp = *con_cls;
   2064 
   2065        if (pp == NULL)
   2066          {
   2067            pp = MHD_create_post_processor(connection, ...);
   2068            *con_cls = pp;
   2069            return MHD_YES;
   2070          }
   2071        if (*upload_data_size)
   2072          {
   2073            MHD_post_process(pp, upload_data, *upload_data_size);
   2074            *upload_data_size = 0;
   2075            return MHD_YES;
   2076          }
   2077        else
   2078          {
   2079            MHD_destroy_post_processor(pp);
   2080            return MHD_queue_response(...);
   2081          }
   2082      }
   2083 
   2084    Note that the callback from 'MHD_OPTION_NOTIFY_COMPLETED' should be
   2085 used to destroy the post processor.  This cannot be done inside of the
   2086 access handler since the connection may not always terminate normally.
   2087 
   2088 
   2089 File: libmicrohttpd.info,  Node: microhttpd-post api,  Up: microhttpd-post
   2090 
   2091 11.1 Programming interface for the 'POST' processor
   2092 ===================================================
   2093 
   2094  -- Function: struct MHD_PostProcessor * MHD_create_post_processor
   2095           (struct MHD_Connection *connection, size_t buffer_size,
   2096           MHD_PostDataIterator iterator, void *iterator_cls)
   2097      Create a PostProcessor.  A PostProcessor can be used to
   2098      (incrementally) parse the data portion of a 'POST' request.
   2099 
   2100      CONNECTION
   2101           the connection on which the 'POST' is happening (used to
   2102           determine the 'POST' format);
   2103 
   2104      BUFFER_SIZE
   2105           maximum number of bytes to use for internal buffering (used
   2106           only for the parsing, specifically the parsing of the keys).
   2107           A tiny value (256-1024) should be sufficient; do *NOT* use a
   2108           value smaller than 256; for good performance, use 32k or 64k
   2109           (i.e.  65536).
   2110 
   2111      ITERATOR
   2112           iterator to be called with the parsed data; must *NOT* be
   2113           'NULL';
   2114 
   2115      ITERATOR_CLS
   2116           custom value to be used as first argument to ITERATOR.
   2117 
   2118      Return 'NULL' on error (out of memory, unsupported encoding),
   2119      otherwise a PP handle.
   2120 
   2121  -- Function: int MHD_post_process (struct MHD_PostProcessor *pp, const
   2122           char *post_data, size_t post_data_len)
   2123      Parse and process 'POST' data.  Call this function when 'POST' data
   2124      is available (usually during an 'MHD_AccessHandlerCallback') with
   2125      the UPLOAD_DATA and UPLOAD_DATA_SIZE.  Whenever possible, this will
   2126      then cause calls to the 'MHD_IncrementalKeyValueIterator'.
   2127 
   2128      PP
   2129           the post processor;
   2130 
   2131      POST_DATA
   2132           POST_DATA_LEN bytes of 'POST' data;
   2133 
   2134      POST_DATA_LEN
   2135           length of POST_DATA.
   2136 
   2137      Return 'MHD_YES' on success, 'MHD_NO' on error (out-of-memory,
   2138      iterator aborted, parse error).
   2139 
   2140  -- Function: int MHD_destroy_post_processor (struct MHD_PostProcessor
   2141           *pp)
   2142      Release PostProcessor resources.  After this function is being
   2143      called, the PostProcessor is guaranteed to no longer call its
   2144      iterator.  There is no special call to the iterator to indicate the
   2145      end of the post processing stream.  After destroying the
   2146      PostProcessor, the programmer should perform any necessary work to
   2147      complete the processing of the iterator.
   2148 
   2149      Return 'MHD_YES' if processing completed nicely, 'MHD_NO' if there
   2150      were spurious characters or formatting problems with the post
   2151      request.  It is common to ignore the return value of this function.
   2152 
   2153 
   2154 File: libmicrohttpd.info,  Node: microhttpd-info,  Next: microhttpd-util,  Prev: microhttpd-post,  Up: Top
   2155 
   2156 12 Obtaining and modifying status information.
   2157 **********************************************
   2158 
   2159 * Menu:
   2160 
   2161 * microhttpd-info daemon::        State information about an MHD daemon
   2162 * microhttpd-info conn::          State information about a connection
   2163 * microhttpd-option conn::        Modify per-connection options
   2164 
   2165 
   2166 File: libmicrohttpd.info,  Node: microhttpd-info daemon,  Next: microhttpd-info conn,  Up: microhttpd-info
   2167 
   2168 12.1 Obtaining state information about an MHD daemon
   2169 ====================================================
   2170 
   2171  -- Function: const union MHD_DaemonInfo * MHD_get_daemon_info (struct
   2172           MHD_Daemon *daemon, enum MHD_DaemonInfoType infoType, ...)
   2173      Obtain information about the given daemon.  This function is
   2174      currently not fully implemented.
   2175 
   2176      DAEMON
   2177           the daemon about which information is desired;
   2178 
   2179      INFOTYPE
   2180           type of information that is desired
   2181 
   2182      ...
   2183           additional arguments about the desired information (depending
   2184           on infoType)
   2185 
   2186      Returns a union with the respective member (depending on infoType)
   2187      set to the desired information), or 'NULL' in case the desired
   2188      information is not available or applicable.
   2189 
   2190  -- Enumeration: MHD_DaemonInfoType
   2191      Values of this enum are used to specify what information about a
   2192      daemon is desired.
   2193      'MHD_DAEMON_INFO_KEY_SIZE'
   2194           Request information about the key size for a particular cipher
   2195           algorithm.  The cipher algorithm should be passed as an extra
   2196           argument (of type 'enum MHD_GNUTLS_CipherAlgorithm').  No
   2197           longer supported, using this value will cause
   2198           'MHD_get_daemon_info' to return NULL.
   2199 
   2200      'MHD_DAEMON_INFO_MAC_KEY_SIZE'
   2201           Request information about the key size for a particular cipher
   2202           algorithm.  The cipher algorithm should be passed as an extra
   2203           argument (of type 'enum MHD_GNUTLS_HashAlgorithm').  No longer
   2204           supported, using this value will cause 'MHD_get_daemon_info'
   2205           to return NULL.
   2206 
   2207      'MHD_DAEMON_INFO_LISTEN_FD'
   2208           Request the file-descriptor number that MHD is using to listen
   2209           to the server socket.  This can be useful if no port was
   2210           specified and a client needs to learn what port is actually
   2211           being used by MHD. No extra arguments should be passed.
   2212 
   2213      'MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY'
   2214           Request the file-descriptor number that MHD is using for
   2215           epoll.  If the build is not supporting epoll, NULL is
   2216           returned; if we are using a thread pool or this daemon was not
   2217           started with 'MHD_USE_EPOLL_LINUX_ONLY', (a pointer to) -1 is
   2218           returned.  If we are using 'MHD_USE_SELECT_INTERNALLY' or are
   2219           in 'external' select mode, the internal epoll FD is returned.
   2220           This function must be used in external select mode with epoll
   2221           to obtain the FD to call epoll on.  No extra arguments should
   2222           be passed.
   2223 
   2224      'MHD_DAEMON_INFO_CURRENT_CONNECTIONS'
   2225           Request the number of current connections handled by the
   2226           daemon.  No extra arguments should be passed and a pointer to
   2227           a 'union MHD_DaemonInfo' value is returned, with the
   2228           'num_connections' member of type 'unsigned int' set to the
   2229           number of active connections.
   2230 
   2231           Note that in multi-threaded or internal-select mode, the real
   2232           number of current connections may already be different when
   2233           'MHD_get_daemon_info' returns.  The number of current
   2234           connections can be used (even in multi-threaded and
   2235           internal-select mode) after 'MHD_quiesce_daemon' to detect
   2236           whether all connections have been handled.
   2237 
   2238 
   2239 File: libmicrohttpd.info,  Node: microhttpd-info conn,  Next: microhttpd-option conn,  Prev: microhttpd-info daemon,  Up: microhttpd-info
   2240 
   2241 12.2 Obtaining state information about a connection
   2242 ===================================================
   2243 
   2244  -- Function: const union MHD_ConnectionInfo * MHD_get_connection_info
   2245           (struct MHD_Connection *daemon, enum MHD_ConnectionInfoType
   2246           infoType, ...)
   2247      Obtain information about the given connection.
   2248 
   2249      CONNECTION
   2250           the connection about which information is desired;
   2251 
   2252      INFOTYPE
   2253           type of information that is desired
   2254 
   2255      ...
   2256           additional arguments about the desired information (depending
   2257           on infoType)
   2258 
   2259      Returns a union with the respective member (depending on infoType)
   2260      set to the desired information), or 'NULL' in case the desired
   2261      information is not available or applicable.
   2262 
   2263  -- Enumeration: MHD_ConnectionInfoType
   2264      Values of this enum are used to specify what information about a
   2265      connection is desired.
   2266 
   2267      'MHD_CONNECTION_INFO_CIPHER_ALGO'
   2268           What cipher algorithm is being used (HTTPS connections only).
   2269           Takes no extra arguments.  'NULL' is returned for non-HTTPS
   2270           connections.
   2271 
   2272      'MHD_CONNECTION_INFO_PROTOCOL,'
   2273           Takes no extra arguments.  Allows finding out the TLS/SSL
   2274           protocol used (HTTPS connections only).  'NULL' is returned
   2275           for non-HTTPS connections.
   2276 
   2277      'MHD_CONNECTION_INFO_CLIENT_ADDRESS'
   2278           Returns information about the address of the client.  Returns
   2279           essentially a 'struct sockaddr **' (since the API returns a
   2280           'union MHD_ConnectionInfo *' and that union contains a 'struct
   2281           sockaddr *').
   2282 
   2283      'MHD_CONNECTION_INFO_GNUTLS_SESSION,'
   2284           Takes no extra arguments.  Allows access to the underlying
   2285           GNUtls session, including access to the underlying GNUtls
   2286           client certificate (HTTPS connections only).  Takes no extra
   2287           arguments.  'NULL' is returned for non-HTTPS connections.
   2288 
   2289      'MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,'
   2290           Dysfunctional (never implemented, deprecated).  Use
   2291           MHD_CONNECTION_INFO_GNUTLS_SESSION to get the
   2292           'gnutls_session_t' and then call
   2293           'gnutls_certificate_get_peers()'.
   2294 
   2295      'MHD_CONNECTION_INFO_DAEMON'
   2296           Returns information about 'struct MHD_Daemon' which manages
   2297           this connection.
   2298 
   2299      'MHD_CONNECTION_INFO_CONNECTION_FD'
   2300           Returns the file descriptor (usually a TCP socket) associated
   2301           with this connection (in the "connect-fd" member of the
   2302           returned struct).  Note that manipulating the descriptor
   2303           directly can have problematic consequences (as in, break
   2304           HTTP). Applications might use this access to manipulate TCP
   2305           options, for example to set the "TCP-NODELAY" option for
   2306           COMET-like applications.  Note that MHD will set TCP-CORK
   2307           after sending the HTTP header and clear it after finishing the
   2308           footers automatically (if the platform supports it).  As the
   2309           connection callbacks are invoked in between, those might be
   2310           used to set different values for TCP-CORK and TCP-NODELAY in
   2311           the meantime.
   2312 
   2313      'MHD_CONNECTION_INFO_SOCKET_CONTEXT'
   2314           Returns the client-specific pointer to a 'void *' that was
   2315           (possibly) set during a 'MHD_NotifyConnectionCallback' when
   2316           the socket was first accepted.  Note that this is NOT the same
   2317           as the 'con_cls' argument of the 'MHD_AccessHandlerCallback'.
   2318           The 'con_cls' is fresh for each HTTP request, while the
   2319           'socket_context' is fresh for each socket.
   2320 
   2321 
   2322 File: libmicrohttpd.info,  Node: microhttpd-option conn,  Prev: microhttpd-info conn,  Up: microhttpd-info
   2323 
   2324 12.3 Setting custom options for an individual connection
   2325 ========================================================
   2326 
   2327  -- Function: int MHD_set_connection_option (struct MHD_Connection
   2328           *daemon, enum MHD_CONNECTION_OPTION option, ...)
   2329      Set a custom option for the given connection.
   2330 
   2331      CONNECTION
   2332           the connection for which an option should be set or modified;
   2333 
   2334      OPTION
   2335           option to set
   2336 
   2337      ...
   2338           additional arguments for the option (depending on option)
   2339 
   2340      Returns 'MHD_YES' on success, 'MHD_NO' for errors (i.e.  option
   2341      argument invalid or option unknown).
   2342 
   2343  -- Enumeration: MHD_CONNECTION_OPTION
   2344      Values of this enum are used to specify which option for a
   2345      connection should be changed.
   2346 
   2347      'MHD_CONNECTION_OPTION_TIMEOUT'
   2348           Set a custom timeout for the given connection.  Specified as
   2349           the number of seconds, given as an 'unsigned int'.  Use zero
   2350           for no timeout.
   2351 
   2352 
   2353 File: libmicrohttpd.info,  Node: microhttpd-util,  Next: GNU-LGPL,  Prev: microhttpd-info,  Up: Top
   2354 
   2355 13 Utility functions.
   2356 *********************
   2357 
   2358 * Menu:
   2359 
   2360 * microhttpd-util feature::       Test supported MHD features
   2361 * microhttpd-util unescape::      Unescape strings
   2362 
   2363 
   2364 File: libmicrohttpd.info,  Node: microhttpd-util feature,  Next: microhttpd-util unescape,  Up: microhttpd-util
   2365 
   2366 13.1 Testing for supported MHD features
   2367 =======================================
   2368 
   2369  -- Enumeration: MHD_FEATURE
   2370      Values of this enum are used to specify what information about a
   2371      daemon is desired.
   2372      'MHD_FEATURE_MESSAGES'
   2373           Get whether messages are supported.  If supported then in
   2374           debug mode messages can be printed to stderr or to external
   2375           logger.
   2376 
   2377      'MHD_FEATURE_SSL'
   2378           Get whether HTTPS is supported.  If supported then flag
   2379           MHD_USE_SSL and options MHD_OPTION_HTTPS_MEM_KEY,
   2380           MHD_OPTION_HTTPS_MEM_CERT, MHD_OPTION_HTTPS_MEM_TRUST,
   2381           MHD_OPTION_HTTPS_MEM_DHPARAMS, MHD_OPTION_HTTPS_CRED_TYPE,
   2382           MHD_OPTION_HTTPS_PRIORITIES can be used.
   2383 
   2384      'MHD_FEATURE_HTTPS_CERT_CALLBACK'
   2385           Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is
   2386           supported.
   2387 
   2388      'MHD_FEATURE_IPv6'
   2389           Get whether IPv6 is supported.  If supported then flag
   2390           MHD_USE_IPv6 can be used.
   2391 
   2392      'MHD_FEATURE_IPv6_ONLY'
   2393           Get whether IPv6 without IPv4 is supported.  If not supported
   2394           then IPv4 is always enabled in IPv6 sockets and flag
   2395           MHD_USE_DUAL_STACK if always used when MHD_USE_IPv6 is
   2396           specified.
   2397 
   2398      'MHD_FEATURE_POLL'
   2399           Get whether 'poll()' is supported.  If supported then flag
   2400           MHD_USE_POLL can be used.
   2401 
   2402      'MHD_FEATURE_EPOLL'
   2403           Get whether 'epoll()' is supported.  If supported then Flags
   2404           MHD_USE_EPOLL_LINUX_ONLY and
   2405           MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY can be used.
   2406 
   2407      'MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET'
   2408           Get whether shutdown on listen socket to signal other threads
   2409           is supported.  If not supported flag MHD_USE_PIPE_FOR_SHUTDOWN
   2410           is automatically forced.
   2411 
   2412      'MHD_FEATURE_SOCKETPAIR'
   2413           Get whether a 'socketpair()' is used internally instead of a
   2414           'pipe()' to signal other threads.
   2415 
   2416      'MHD_FEATURE_TCP_FASTOPEN'
   2417           Get whether TCP Fast Open is supported.  If supported then
   2418           flag MHD_USE_TCP_FASTOPEN and option
   2419           MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used.
   2420 
   2421      'MHD_FEATURE_BASIC_AUTH'
   2422           Get whether HTTP Basic authorization is supported.  If
   2423           supported then functions
   2424           'MHD_basic_auth_get_username_password()' and
   2425           'MHD_queue_basic_auth_fail_response()' can be used.
   2426 
   2427      'MHD_FEATURE_DIGEST_AUTH'
   2428           Get whether HTTP Digest authorization is supported.  If
   2429           supported then options MHD_OPTION_DIGEST_AUTH_RANDOM,
   2430           MHD_OPTION_NONCE_NC_SIZE and functions
   2431           'MHD_digest_auth_check()', can be used.
   2432 
   2433      'MHD_FEATURE_POSTPROCESSOR'
   2434           Get whether postprocessor is supported.  If supported then
   2435           functions 'MHD_create_post_processor()', 'MHD_post_process()',
   2436           'MHD_destroy_post_processor()' can be used.
   2437 
   2438  -- Function: int MHD_is_feature_supported (enum MHD_FEATURE feature)
   2439      Get information about supported MHD features.  Indicate that MHD
   2440      was compiled with or without support for particular feature.  Some
   2441      features require additional support by the kernel.  However, kernel
   2442      support is not checked by this function.
   2443 
   2444      FEATURE
   2445           type of requested information
   2446 
   2447      Returns 'MHD_YES' if the feature is supported, and 'MHD_NO' if not.
   2448 
   2449 
   2450 File: libmicrohttpd.info,  Node: microhttpd-util unescape,  Prev: microhttpd-util feature,  Up: microhttpd-util
   2451 
   2452 13.2 Unescape strings
   2453 =====================
   2454 
   2455  -- Function: size_t MHD_http_unescape (char *val)
   2456      Process escape sequences ('%HH') Updates val in place; the result
   2457      should be UTF-8 encoded and cannot be larger than the input.  The
   2458      result must also still be 0-terminated.
   2459 
   2460      VAL
   2461           value to unescape (modified in the process), must be a
   2462           0-terminated UTF-8 string.
   2463 
   2464      Returns length of the resulting val ('strlen(val)' may be shorter
   2465      afterwards due to elimination of escape sequences).
   2466 
   2467 
   2468 File: libmicrohttpd.info,  Node: GNU-LGPL,  Next: GNU GPL with eCos Extension,  Prev: microhttpd-util,  Up: Top
   2469 
   2470 GNU-LGPL
   2471 ********
   2472 
   2473                       Version 2.1, February 1999
   2474 
   2475      Copyright (C) 1991, 1999 Free Software Foundation, Inc.
   2476      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
   2477 
   2478      Everyone is permitted to copy and distribute verbatim copies
   2479      of this license document, but changing it is not allowed.
   2480 
   2481      [This is the first released version of the Lesser GPL.  It also counts
   2482      as the successor of the GNU Library Public License, version 2, hence the
   2483      version number 2.1.]
   2484 
   2485 Preamble
   2486 --------
   2487 
   2488 The licenses for most software are designed to take away your freedom to
   2489 share and change it.  By contrast, the GNU General Public Licenses are
   2490 intended to guarantee your freedom to share and change free software--to
   2491 make sure the software is free for all its users.
   2492 
   2493    This license, the Lesser General Public License, applies to some
   2494 specially designated software--typically libraries--of the Free Software
   2495 Foundation and other authors who decide to use it.  You can use it too,
   2496 but we suggest you first think carefully about whether this license or
   2497 the ordinary General Public License is the better strategy to use in any
   2498 particular case, based on the explanations below.
   2499 
   2500    When we speak of free software, we are referring to freedom of use,
   2501 not price.  Our General Public Licenses are designed to make sure that
   2502 you have the freedom to distribute copies of free software (and charge
   2503 for this service if you wish); that you receive source code or can get
   2504 it if you want it; that you can change the software and use pieces of it
   2505 in new free programs; and that you are informed that you can do these
   2506 things.
   2507 
   2508    To protect your rights, we need to make restrictions that forbid
   2509 distributors to deny you these rights or to ask you to surrender these
   2510 rights.  These restrictions translate to certain responsibilities for
   2511 you if you distribute copies of the library or if you modify it.
   2512 
   2513    For example, if you distribute copies of the library, whether gratis
   2514 or for a fee, you must give the recipients all the rights that we gave
   2515 you.  You must make sure that they, too, receive or can get the source
   2516 code.  If you link other code with the library, you must provide
   2517 complete object files to the recipients, so that they can relink them
   2518 with the library after making changes to the library and recompiling it.
   2519 And you must show them these terms so they know their rights.
   2520 
   2521    We protect your rights with a two-step method: (1) we copyright the
   2522 library, and (2) we offer you this license, which gives you legal
   2523 permission to copy, distribute and/or modify the library.
   2524 
   2525    To protect each distributor, we want to make it very clear that there
   2526 is no warranty for the free library.  Also, if the library is modified
   2527 by someone else and passed on, the recipients should know that what they
   2528 have is not the original version, so that the original author's
   2529 reputation will not be affected by problems that might be introduced by
   2530 others.
   2531 
   2532    Finally, software patents pose a constant threat to the existence of
   2533 any free program.  We wish to make sure that a company cannot
   2534 effectively restrict the users of a free program by obtaining a
   2535 restrictive license from a patent holder.  Therefore, we insist that any
   2536 patent license obtained for a version of the library must be consistent
   2537 with the full freedom of use specified in this license.
   2538 
   2539    Most GNU software, including some libraries, is covered by the
   2540 ordinary GNU General Public License.  This license, the GNU Lesser
   2541 General Public License, applies to certain designated libraries, and is
   2542 quite different from the ordinary General Public License.  We use this
   2543 license for certain libraries in order to permit linking those libraries
   2544 into non-free programs.
   2545 
   2546    When a program is linked with a library, whether statically or using
   2547 a shared library, the combination of the two is legally speaking a
   2548 combined work, a derivative of the original library.  The ordinary
   2549 General Public License therefore permits such linking only if the entire
   2550 combination fits its criteria of freedom.  The Lesser General Public
   2551 License permits more lax criteria for linking other code with the
   2552 library.
   2553 
   2554    We call this license the "Lesser" General Public License because it
   2555 does _Less_ to protect the user's freedom than the ordinary General
   2556 Public License.  It also provides other free software developers Less of
   2557 an advantage over competing non-free programs.  These disadvantages are
   2558 the reason we use the ordinary General Public License for many
   2559 libraries.  However, the Lesser license provides advantages in certain
   2560 special circumstances.
   2561 
   2562    For example, on rare occasions, there may be a special need to
   2563 encourage the widest possible use of a certain library, so that it
   2564 becomes a de-facto standard.  To achieve this, non-free programs must be
   2565 allowed to use the library.  A more frequent case is that a free library
   2566 does the same job as widely used non-free libraries.  In this case,
   2567 there is little to gain by limiting the free library to free software
   2568 only, so we use the Lesser General Public License.
   2569 
   2570    In other cases, permission to use a particular library in non-free
   2571 programs enables a greater number of people to use a large body of free
   2572 software.  For example, permission to use the GNU C Library in non-free
   2573 programs enables many more people to use the whole GNU operating system,
   2574 as well as its variant, the GNU/Linux operating system.
   2575 
   2576    Although the Lesser General Public License is Less protective of the
   2577 users' freedom, it does ensure that the user of a program that is linked
   2578 with the Library has the freedom and the wherewithal to run that program
   2579 using a modified version of the Library.
   2580 
   2581    The precise terms and conditions for copying, distribution and
   2582 modification follow.  Pay close attention to the difference between a
   2583 "work based on the library" and a "work that uses the library".  The
   2584 former contains code derived from the library, whereas the latter must
   2585 be combined with the library in order to run.
   2586 
   2587 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
   2588 ---------------------------------------------------------------
   2589 
   2590   0. This License Agreement applies to any software library or other
   2591      program which contains a notice placed by the copyright holder or
   2592      other authorized party saying it may be distributed under the terms
   2593      of this Lesser General Public License (also called "this License").
   2594      Each licensee is addressed as "you".
   2595 
   2596      A "library" means a collection of software functions and/or data
   2597      prepared so as to be conveniently linked with application programs
   2598      (which use some of those functions and data) to form executables.
   2599 
   2600      The "Library", below, refers to any such software library or work
   2601      which has been distributed under these terms.  A "work based on the
   2602      Library" means either the Library or any derivative work under
   2603      copyright law: that is to say, a work containing the Library or a
   2604      portion of it, either verbatim or with modifications and/or
   2605      translated straightforwardly into another language.  (Hereinafter,
   2606      translation is included without limitation in the term
   2607      "modification".)
   2608 
   2609      "Source code" for a work means the preferred form of the work for
   2610      making modifications to it.  For a library, complete source code
   2611      means all the source code for all modules it contains, plus any
   2612      associated interface definition files, plus the scripts used to
   2613      control compilation and installation of the library.
   2614 
   2615      Activities other than copying, distribution and modification are
   2616      not covered by this License; they are outside its scope.  The act
   2617      of running a program using the Library is not restricted, and
   2618      output from such a program is covered only if its contents
   2619      constitute a work based on the Library (independent of the use of
   2620      the Library in a tool for writing it).  Whether that is true
   2621      depends on what the Library does and what the program that uses the
   2622      Library does.
   2623 
   2624   1. You may copy and distribute verbatim copies of the Library's
   2625      complete source code as you receive it, in any medium, provided
   2626      that you conspicuously and appropriately publish on each copy an
   2627      appropriate copyright notice and disclaimer of warranty; keep
   2628      intact all the notices that refer to this License and to the
   2629      absence of any warranty; and distribute a copy of this License
   2630      along with the Library.
   2631 
   2632      You may charge a fee for the physical act of transferring a copy,
   2633      and you may at your option offer warranty protection in exchange
   2634      for a fee.
   2635 
   2636   2. You may modify your copy or copies of the Library or any portion of
   2637      it, thus forming a work based on the Library, and copy and
   2638      distribute such modifications or work under the terms of Section 1
   2639      above, provided that you also meet all of these conditions:
   2640 
   2641        a. The modified work must itself be a software library.
   2642 
   2643        b. You must cause the files modified to carry prominent notices
   2644           stating that you changed the files and the date of any change.
   2645 
   2646        c. You must cause the whole of the work to be licensed at no
   2647           charge to all third parties under the terms of this License.
   2648 
   2649        d. If a facility in the modified Library refers to a function or
   2650           a table of data to be supplied by an application program that
   2651           uses the facility, other than as an argument passed when the
   2652           facility is invoked, then you must make a good faith effort to
   2653           ensure that, in the event an application does not supply such
   2654           function or table, the facility still operates, and performs
   2655           whatever part of its purpose remains meaningful.
   2656 
   2657           (For example, a function in a library to compute square roots
   2658           has a purpose that is entirely well-defined independent of the
   2659           application.  Therefore, Subsection 2d requires that any
   2660           application-supplied function or table used by this function
   2661           must be optional: if the application does not supply it, the
   2662           square root function must still compute square roots.)
   2663 
   2664      These requirements apply to the modified work as a whole.  If
   2665      identifiable sections of that work are not derived from the
   2666      Library, and can be reasonably considered independent and separate
   2667      works in themselves, then this License, and its terms, do not apply
   2668      to those sections when you distribute them as separate works.  But
   2669      when you distribute the same sections as part of a whole which is a
   2670      work based on the Library, the distribution of the whole must be on
   2671      the terms of this License, whose permissions for other licensees
   2672      extend to the entire whole, and thus to each and every part
   2673      regardless of who wrote it.
   2674 
   2675      Thus, it is not the intent of this section to claim rights or
   2676      contest your rights to work written entirely by you; rather, the
   2677      intent is to exercise the right to control the distribution of
   2678      derivative or collective works based on the Library.
   2679 
   2680      In addition, mere aggregation of another work not based on the
   2681      Library with the Library (or with a work based on the Library) on a
   2682      volume of a storage or distribution medium does not bring the other
   2683      work under the scope of this License.
   2684 
   2685   3. You may opt to apply the terms of the ordinary GNU General Public
   2686      License instead of this License to a given copy of the Library.  To
   2687      do this, you must alter all the notices that refer to this License,
   2688      so that they refer to the ordinary GNU General Public License,
   2689      version 2, instead of to this License.  (If a newer version than
   2690      version 2 of the ordinary GNU General Public License has appeared,
   2691      then you can specify that version instead if you wish.)  Do not
   2692      make any other change in these notices.
   2693 
   2694      Once this change is made in a given copy, it is irreversible for
   2695      that copy, so the ordinary GNU General Public License applies to
   2696      all subsequent copies and derivative works made from that copy.
   2697 
   2698      This option is useful when you wish to copy part of the code of the
   2699      Library into a program that is not a library.
   2700 
   2701   4. You may copy and distribute the Library (or a portion or derivative
   2702      of it, under Section 2) in object code or executable form under the
   2703      terms of Sections 1 and 2 above provided that you accompany it with
   2704      the complete corresponding machine-readable source code, which must
   2705      be distributed under the terms of Sections 1 and 2 above on a
   2706      medium customarily used for software interchange.
   2707 
   2708      If distribution of object code is made by offering access to copy
   2709      from a designated place, then offering equivalent access to copy
   2710      the source code from the same place satisfies the requirement to
   2711      distribute the source code, even though third parties are not
   2712      compelled to copy the source along with the object code.
   2713 
   2714   5. A program that contains no derivative of any portion of the
   2715      Library, but is designed to work with the Library by being compiled
   2716      or linked with it, is called a "work that uses the Library".  Such
   2717      a work, in isolation, is not a derivative work of the Library, and
   2718      therefore falls outside the scope of this License.
   2719 
   2720      However, linking a "work that uses the Library" with the Library
   2721      creates an executable that is a derivative of the Library (because
   2722      it contains portions of the Library), rather than a "work that uses
   2723      the library".  The executable is therefore covered by this License.
   2724      Section 6 states terms for distribution of such executables.
   2725 
   2726      When a "work that uses the Library" uses material from a header
   2727      file that is part of the Library, the object code for the work may
   2728      be a derivative work of the Library even though the source code is
   2729      not.  Whether this is true is especially significant if the work
   2730      can be linked without the Library, or if the work is itself a
   2731      library.  The threshold for this to be true is not precisely
   2732      defined by law.
   2733 
   2734      If such an object file uses only numerical parameters, data
   2735      structure layouts and accessors, and small macros and small inline
   2736      functions (ten lines or less in length), then the use of the object
   2737      file is unrestricted, regardless of whether it is legally a
   2738      derivative work.  (Executables containing this object code plus
   2739      portions of the Library will still fall under Section 6.)
   2740 
   2741      Otherwise, if the work is a derivative of the Library, you may
   2742      distribute the object code for the work under the terms of Section
   2743      6.  Any executables containing that work also fall under Section 6,
   2744      whether or not they are linked directly with the Library itself.
   2745 
   2746   6. As an exception to the Sections above, you may also combine or link
   2747      a "work that uses the Library" with the Library to produce a work
   2748      containing portions of the Library, and distribute that work under
   2749      terms of your choice, provided that the terms permit modification
   2750      of the work for the customer's own use and reverse engineering for
   2751      debugging such modifications.
   2752 
   2753      You must give prominent notice with each copy of the work that the
   2754      Library is used in it and that the Library and its use are covered
   2755      by this License.  You must supply a copy of this License.  If the
   2756      work during execution displays copyright notices, you must include
   2757      the copyright notice for the Library among them, as well as a
   2758      reference directing the user to the copy of this License.  Also,
   2759      you must do one of these things:
   2760 
   2761        a. Accompany the work with the complete corresponding
   2762           machine-readable source code for the Library including
   2763           whatever changes were used in the work (which must be
   2764           distributed under Sections 1 and 2 above); and, if the work is
   2765           an executable linked with the Library, with the complete
   2766           machine-readable "work that uses the Library", as object code
   2767           and/or source code, so that the user can modify the Library
   2768           and then relink to produce a modified executable containing
   2769           the modified Library.  (It is understood that the user who
   2770           changes the contents of definitions files in the Library will
   2771           not necessarily be able to recompile the application to use
   2772           the modified definitions.)
   2773 
   2774        b. Use a suitable shared library mechanism for linking with the
   2775           Library.  A suitable mechanism is one that (1) uses at run
   2776           time a copy of the library already present on the user's
   2777           computer system, rather than copying library functions into
   2778           the executable, and (2) will operate properly with a modified
   2779           version of the library, if the user installs one, as long as
   2780           the modified version is interface-compatible with the version
   2781           that the work was made with.
   2782 
   2783        c. Accompany the work with a written offer, valid for at least
   2784           three years, to give the same user the materials specified in
   2785           Subsection 6a, above, for a charge no more than the cost of
   2786           performing this distribution.
   2787 
   2788        d. If distribution of the work is made by offering access to copy
   2789           from a designated place, offer equivalent access to copy the
   2790           above specified materials from the same place.
   2791 
   2792        e. Verify that the user has already received a copy of these
   2793           materials or that you have already sent this user a copy.
   2794 
   2795      For an executable, the required form of the "work that uses the
   2796      Library" must include any data and utility programs needed for
   2797      reproducing the executable from it.  However, as a special
   2798      exception, the materials to be distributed need not include
   2799      anything that is normally distributed (in either source or binary
   2800      form) with the major components (compiler, kernel, and so on) of
   2801      the operating system on which the executable runs, unless that
   2802      component itself accompanies the executable.
   2803 
   2804      It may happen that this requirement contradicts the license
   2805      restrictions of other proprietary libraries that do not normally
   2806      accompany the operating system.  Such a contradiction means you
   2807      cannot use both them and the Library together in an executable that
   2808      you distribute.
   2809 
   2810   7. You may place library facilities that are a work based on the
   2811      Library side-by-side in a single library together with other
   2812      library facilities not covered by this License, and distribute such
   2813      a combined library, provided that the separate distribution of the
   2814      work based on the Library and of the other library facilities is
   2815      otherwise permitted, and provided that you do these two things:
   2816 
   2817        a. Accompany the combined library with a copy of the same work
   2818           based on the Library, uncombined with any other library
   2819           facilities.  This must be distributed under the terms of the
   2820           Sections above.
   2821 
   2822        b. Give prominent notice with the combined library of the fact
   2823           that part of it is a work based on the Library, and explaining
   2824           where to find the accompanying uncombined form of the same
   2825           work.
   2826 
   2827   8. You may not copy, modify, sublicense, link with, or distribute the
   2828      Library except as expressly provided under this License.  Any
   2829      attempt otherwise to copy, modify, sublicense, link with, or
   2830      distribute the Library is void, and will automatically terminate
   2831      your rights under this License.  However, parties who have received
   2832      copies, or rights, from you under this License will not have their
   2833      licenses terminated so long as such parties remain in full
   2834      compliance.
   2835 
   2836   9. You are not required to accept this License, since you have not
   2837      signed it.  However, nothing else grants you permission to modify
   2838      or distribute the Library or its derivative works.  These actions
   2839      are prohibited by law if you do not accept this License.
   2840      Therefore, by modifying or distributing the Library (or any work
   2841      based on the Library), you indicate your acceptance of this License
   2842      to do so, and all its terms and conditions for copying,
   2843      distributing or modifying the Library or works based on it.
   2844 
   2845   10. Each time you redistribute the Library (or any work based on the
   2846      Library), the recipient automatically receives a license from the
   2847      original licensor to copy, distribute, link with or modify the
   2848      Library subject to these terms and conditions.  You may not impose
   2849      any further restrictions on the recipients' exercise of the rights
   2850      granted herein.  You are not responsible for enforcing compliance
   2851      by third parties with this License.
   2852 
   2853   11. If, as a consequence of a court judgment or allegation of patent
   2854      infringement or for any other reason (not limited to patent
   2855      issues), conditions are imposed on you (whether by court order,
   2856      agreement or otherwise) that contradict the conditions of this
   2857      License, they do not excuse you from the conditions of this
   2858      License.  If you cannot distribute so as to satisfy simultaneously
   2859      your obligations under this License and any other pertinent
   2860      obligations, then as a consequence you may not distribute the
   2861      Library at all.  For example, if a patent license would not permit
   2862      royalty-free redistribution of the Library by all those who receive
   2863      copies directly or indirectly through you, then the only way you
   2864      could satisfy both it and this License would be to refrain entirely
   2865      from distribution of the Library.
   2866 
   2867      If any portion of this section is held invalid or unenforceable
   2868      under any particular circumstance, the balance of the section is
   2869      intended to apply, and the section as a whole is intended to apply
   2870      in other circumstances.
   2871 
   2872      It is not the purpose of this section to induce you to infringe any
   2873      patents or other property right claims or to contest validity of
   2874      any such claims; this section has the sole purpose of protecting
   2875      the integrity of the free software distribution system which is
   2876      implemented by public license practices.  Many people have made
   2877      generous contributions to the wide range of software distributed
   2878      through that system in reliance on consistent application of that
   2879      system; it is up to the author/donor to decide if he or she is
   2880      willing to distribute software through any other system and a
   2881      licensee cannot impose that choice.
   2882 
   2883      This section is intended to make thoroughly clear what is believed
   2884      to be a consequence of the rest of this License.
   2885 
   2886   12. If the distribution and/or use of the Library is restricted in
   2887      certain countries either by patents or by copyrighted interfaces,
   2888      the original copyright holder who places the Library under this
   2889      License may add an explicit geographical distribution limitation
   2890      excluding those countries, so that distribution is permitted only
   2891      in or among countries not thus excluded.  In such case, this
   2892      License incorporates the limitation as if written in the body of
   2893      this License.
   2894 
   2895   13. The Free Software Foundation may publish revised and/or new
   2896      versions of the Lesser General Public License from time to time.
   2897      Such new versions will be similar in spirit to the present version,
   2898      but may differ in detail to address new problems or concerns.
   2899 
   2900      Each version is given a distinguishing version number.  If the
   2901      Library specifies a version number of this License which applies to
   2902      it and "any later version", you have the option of following the
   2903      terms and conditions either of that version or of any later version
   2904      published by the Free Software Foundation.  If the Library does not
   2905      specify a license version number, you may choose any version ever
   2906      published by the Free Software Foundation.
   2907 
   2908   14. If you wish to incorporate parts of the Library into other free
   2909      programs whose distribution conditions are incompatible with these,
   2910      write to the author to ask for permission.  For software which is
   2911      copyrighted by the Free Software Foundation, write to the Free
   2912      Software Foundation; we sometimes make exceptions for this.  Our
   2913      decision will be guided by the two goals of preserving the free
   2914      status of all derivatives of our free software and of promoting the
   2915      sharing and reuse of software generally.
   2916 
   2917                               NO WARRANTY
   2918 
   2919   15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
   2920      WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
   2921      LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
   2922      AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY
   2923      OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
   2924      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   2925      FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
   2926      PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE
   2927      DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
   2928      OR CORRECTION.
   2929 
   2930   16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
   2931      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
   2932      MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
   2933      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
   2934      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
   2935      INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
   2936      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
   2937      OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY
   2938      OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
   2939      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
   2940 
   2941 END OF TERMS AND CONDITIONS
   2942 ---------------------------
   2943 
   2944 How to Apply These Terms to Your New Libraries
   2945 ----------------------------------------------
   2946 
   2947 If you develop a new library, and you want it to be of the greatest
   2948 possible use to the public, we recommend making it free software that
   2949 everyone can redistribute and change.  You can do so by permitting
   2950 redistribution under these terms (or, alternatively, under the terms of
   2951 the ordinary General Public License).
   2952 
   2953    To apply these terms, attach the following notices to the library.
   2954 It is safest to attach them to the start of each source file to most
   2955 effectively convey the exclusion of warranty; and each file should have
   2956 at least the "copyright" line and a pointer to where the full notice is
   2957 found.
   2958 
   2959      ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES.
   2960      Copyright (C) YEAR  NAME OF AUTHOR
   2961 
   2962      This library is free software; you can redistribute it and/or modify it
   2963      under the terms of the GNU Lesser General Public License as published by
   2964      the Free Software Foundation; either version 2.1 of the License, or (at
   2965      your option) any later version.
   2966 
   2967      This library is distributed in the hope that it will be useful, but
   2968      WITHOUT ANY WARRANTY; without even the implied warranty of
   2969      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   2970      Lesser General Public License for more details.
   2971 
   2972      You should have received a copy of the GNU Lesser General Public
   2973      License along with this library; if not, write to the Free Software
   2974      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
   2975      USA.
   2976 
   2977    Also add information on how to contact you by electronic and paper
   2978 mail.
   2979 
   2980    You should also get your employer (if you work as a programmer) or
   2981 your school, if any, to sign a "copyright disclaimer" for the library,
   2982 if necessary.  Here is a sample; alter the names:
   2983 
   2984      Yoyodyne, Inc., hereby disclaims all copyright interest in the library
   2985      `Frob' (a library for tweaking knobs) written by James Random Hacker.
   2986 
   2987      SIGNATURE OF TY COON, 1 April 1990
   2988      Ty Coon, President of Vice
   2989 
   2990    That's all there is to it!
   2991 
   2992 
   2993 File: libmicrohttpd.info,  Node: GNU GPL with eCos Extension,  Next: GNU-FDL,  Prev: GNU-LGPL,  Up: Top
   2994 
   2995 GNU GPL with eCos Extension
   2996 ***************************
   2997 
   2998                          Version 2, June 1991
   2999 
   3000      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
   3001      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
   3002 
   3003      Everyone is permitted to copy and distribute verbatim copies
   3004      of this license document, but changing it is not allowed.
   3005 
   3006 Preamble
   3007 --------
   3008 
   3009 The licenses for most software are designed to take away your freedom to
   3010 share and change it.  By contrast, the GNU General Public License is
   3011 intended to guarantee your freedom to share and change free software--to
   3012 make sure the software is free for all its users.  This General Public
   3013 License applies to most of the Free Software Foundation's software and
   3014 to any other program whose authors commit to using it.  (Some other Free
   3015 Software Foundation software is covered by the GNU Library General
   3016 Public License instead.)  You can apply it to your programs, too.
   3017 
   3018    When we speak of free software, we are referring to freedom, not
   3019 price.  Our General Public Licenses are designed to make sure that you
   3020 have the freedom to distribute copies of free software (and charge for
   3021 this service if you wish), that you receive source code or can get it if
   3022 you want it, that you can change the software or use pieces of it in new
   3023 free programs; and that you know you can do these things.
   3024 
   3025    To protect your rights, we need to make restrictions that forbid
   3026 anyone to deny you these rights or to ask you to surrender the rights.
   3027 These restrictions translate to certain responsibilities for you if you
   3028 distribute copies of the software, or if you modify it.
   3029 
   3030    For example, if you distribute copies of such a program, whether
   3031 gratis or for a fee, you must give the recipients all the rights that
   3032 you have.  You must make sure that they, too, receive or can get the
   3033 source code.  And you must show them these terms so they know their
   3034 rights.
   3035 
   3036    We protect your rights with two steps: (1) copyright the software,
   3037 and (2) offer you this license which gives you legal permission to copy,
   3038 distribute and/or modify the software.
   3039 
   3040    Also, for each author's protection and ours, we want to make certain
   3041 that everyone understands that there is no warranty for this free
   3042 software.  If the software is modified by someone else and passed on, we
   3043 want its recipients to know that what they have is not the original, so
   3044 that any problems introduced by others will not reflect on the original
   3045 authors' reputations.
   3046 
   3047    Finally, any free program is threatened constantly by software
   3048 patents.  We wish to avoid the danger that redistributors of a free
   3049 program will individually obtain patent licenses, in effect making the
   3050 program proprietary.  To prevent this, we have made it clear that any
   3051 patent must be licensed for everyone's free use or not licensed at all.
   3052 
   3053    The precise terms and conditions for copying, distribution and
   3054 modification follow.
   3055 
   3056     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
   3057 
   3058   1. This License applies to any program or other work which contains a
   3059      notice placed by the copyright holder saying it may be distributed
   3060      under the terms of this General Public License.  The "Program",
   3061      below, refers to any such program or work, and a "work based on the
   3062      Program" means either the Program or any derivative work under
   3063      copyright law: that is to say, a work containing the Program or a
   3064      portion of it, either verbatim or with modifications and/or
   3065      translated into another language.  (Hereinafter, translation is
   3066      included without limitation in the term "modification".)  Each
   3067      licensee is addressed as "you".
   3068 
   3069      Activities other than copying, distribution and modification are
   3070      not covered by this License; they are outside its scope.  The act
   3071      of running the Program is not restricted, and the output from the
   3072      Program is covered only if its contents constitute a work based on
   3073      the Program (independent of having been made by running the
   3074      Program).  Whether that is true depends on what the Program does.
   3075 
   3076   2. You may copy and distribute verbatim copies of the Program's source
   3077      code as you receive it, in any medium, provided that you
   3078      conspicuously and appropriately publish on each copy an appropriate
   3079      copyright notice and disclaimer of warranty; keep intact all the
   3080      notices that refer to this License and to the absence of any
   3081      warranty; and give any other recipients of the Program a copy of
   3082      this License along with the Program.
   3083 
   3084      You may charge a fee for the physical act of transferring a copy,
   3085      and you may at your option offer warranty protection in exchange
   3086      for a fee.
   3087 
   3088   3. You may modify your copy or copies of the Program or any portion of
   3089      it, thus forming a work based on the Program, and copy and
   3090      distribute such modifications or work under the terms of Section 1
   3091      above, provided that you also meet all of these conditions:
   3092 
   3093        a. You must cause the modified files to carry prominent notices
   3094           stating that you changed the files and the date of any change.
   3095 
   3096        b. You must cause any work that you distribute or publish, that
   3097           in whole or in part contains or is derived from the Program or
   3098           any part thereof, to be licensed as a whole at no charge to
   3099           all third parties under the terms of this License.
   3100 
   3101        c. If the modified program normally reads commands interactively
   3102           when run, you must cause it, when started running for such
   3103           interactive use in the most ordinary way, to print or display
   3104           an announcement including an appropriate copyright notice and
   3105           a notice that there is no warranty (or else, saying that you
   3106           provide a warranty) and that users may redistribute the
   3107           program under these conditions, and telling the user how to
   3108           view a copy of this License.  (Exception: if the Program
   3109           itself is interactive but does not normally print such an
   3110           announcement, your work based on the Program is not required
   3111           to print an announcement.)
   3112 
   3113      These requirements apply to the modified work as a whole.  If
   3114      identifiable sections of that work are not derived from the
   3115      Program, and can be reasonably considered independent and separate
   3116      works in themselves, then this License, and its terms, do not apply
   3117      to those sections when you distribute them as separate works.  But
   3118      when you distribute the same sections as part of a whole which is a
   3119      work based on the Program, the distribution of the whole must be on
   3120      the terms of this License, whose permissions for other licensees
   3121      extend to the entire whole, and thus to each and every part
   3122      regardless of who wrote it.
   3123 
   3124      Thus, it is not the intent of this section to claim rights or
   3125      contest your rights to work written entirely by you; rather, the
   3126      intent is to exercise the right to control the distribution of
   3127      derivative or collective works based on the Program.
   3128 
   3129      In addition, mere aggregation of another work not based on the
   3130      Program with the Program (or with a work based on the Program) on a
   3131      volume of a storage or distribution medium does not bring the other
   3132      work under the scope of this License.
   3133 
   3134   4. You may copy and distribute the Program (or a work based on it,
   3135      under Section 2) in object code or executable form under the terms
   3136      of Sections 1 and 2 above provided that you also do one of the
   3137      following:
   3138 
   3139        a. Accompany it with the complete corresponding machine-readable
   3140           source code, which must be distributed under the terms of
   3141           Sections 1 and 2 above on a medium customarily used for
   3142           software interchange; or,
   3143 
   3144        b. Accompany it with a written offer, valid for at least three
   3145           years, to give any third party, for a charge no more than your
   3146           cost of physically performing source distribution, a complete
   3147           machine-readable copy of the corresponding source code, to be
   3148           distributed under the terms of Sections 1 and 2 above on a
   3149           medium customarily used for software interchange; or,
   3150 
   3151        c. Accompany it with the information you received as to the offer
   3152           to distribute corresponding source code.  (This alternative is
   3153           allowed only for noncommercial distribution and only if you
   3154           received the program in object code or executable form with
   3155           such an offer, in accord with Subsection b above.)
   3156 
   3157      The source code for a work means the preferred form of the work for
   3158      making modifications to it.  For an executable work, complete
   3159      source code means all the source code for all modules it contains,
   3160      plus any associated interface definition files, plus the scripts
   3161      used to control compilation and installation of the executable.
   3162      However, as a special exception, the source code distributed need
   3163      not include anything that is normally distributed (in either source
   3164      or binary form) with the major components (compiler, kernel, and so
   3165      on) of the operating system on which the executable runs, unless
   3166      that component itself accompanies the executable.
   3167 
   3168      If distribution of executable or object code is made by offering
   3169      access to copy from a designated place, then offering equivalent
   3170      access to copy the source code from the same place counts as
   3171      distribution of the source code, even though third parties are not
   3172      compelled to copy the source along with the object code.
   3173 
   3174   5. You may not copy, modify, sublicense, or distribute the Program
   3175      except as expressly provided under this License.  Any attempt
   3176      otherwise to copy, modify, sublicense or distribute the Program is
   3177      void, and will automatically terminate your rights under this
   3178      License.  However, parties who have received copies, or rights,
   3179      from you under this License will not have their licenses terminated
   3180      so long as such parties remain in full compliance.
   3181 
   3182   6. You are not required to accept this License, since you have not
   3183      signed it.  However, nothing else grants you permission to modify
   3184      or distribute the Program or its derivative works.  These actions
   3185      are prohibited by law if you do not accept this License.
   3186      Therefore, by modifying or distributing the Program (or any work
   3187      based on the Program), you indicate your acceptance of this License
   3188      to do so, and all its terms and conditions for copying,
   3189      distributing or modifying the Program or works based on it.
   3190 
   3191   7. Each time you redistribute the Program (or any work based on the
   3192      Program), the recipient automatically receives a license from the
   3193      original licensor to copy, distribute or modify the Program subject
   3194      to these terms and conditions.  You may not impose any further
   3195      restrictions on the recipients' exercise of the rights granted
   3196      herein.  You are not responsible for enforcing compliance by third
   3197      parties to this License.
   3198 
   3199   8. If, as a consequence of a court judgment or allegation of patent
   3200      infringement or for any other reason (not limited to patent
   3201      issues), conditions are imposed on you (whether by court order,
   3202      agreement or otherwise) that contradict the conditions of this
   3203      License, they do not excuse you from the conditions of this
   3204      License.  If you cannot distribute so as to satisfy simultaneously
   3205      your obligations under this License and any other pertinent
   3206      obligations, then as a consequence you may not distribute the
   3207      Program at all.  For example, if a patent license would not permit
   3208      royalty-free redistribution of the Program by all those who receive
   3209      copies directly or indirectly through you, then the only way you
   3210      could satisfy both it and this License would be to refrain entirely
   3211      from distribution of the Program.
   3212 
   3213      If any portion of this section is held invalid or unenforceable
   3214      under any particular circumstance, the balance of the section is
   3215      intended to apply and the section as a whole is intended to apply
   3216      in other circumstances.
   3217 
   3218      It is not the purpose of this section to induce you to infringe any
   3219      patents or other property right claims or to contest validity of
   3220      any such claims; this section has the sole purpose of protecting
   3221      the integrity of the free software distribution system, which is
   3222      implemented by public license practices.  Many people have made
   3223      generous contributions to the wide range of software distributed
   3224      through that system in reliance on consistent application of that
   3225      system; it is up to the author/donor to decide if he or she is
   3226      willing to distribute software through any other system and a
   3227      licensee cannot impose that choice.
   3228 
   3229      This section is intended to make thoroughly clear what is believed
   3230      to be a consequence of the rest of this License.
   3231 
   3232   9. If the distribution and/or use of the Program is restricted in
   3233      certain countries either by patents or by copyrighted interfaces,
   3234      the original copyright holder who places the Program under this
   3235      License may add an explicit geographical distribution limitation
   3236      excluding those countries, so that distribution is permitted only
   3237      in or among countries not thus excluded.  In such case, this
   3238      License incorporates the limitation as if written in the body of
   3239      this License.
   3240 
   3241   10. The Free Software Foundation may publish revised and/or new
   3242      versions of the General Public License from time to time.  Such new
   3243      versions will be similar in spirit to the present version, but may
   3244      differ in detail to address new problems or concerns.
   3245 
   3246      Each version is given a distinguishing version number.  If the
   3247      Program specifies a version number of this License which applies to
   3248      it and "any later version", you have the option of following the
   3249      terms and conditions either of that version or of any later version
   3250      published by the Free Software Foundation.  If the Program does not
   3251      specify a version number of this License, you may choose any
   3252      version ever published by the Free Software Foundation.
   3253 
   3254   11. If you wish to incorporate parts of the Program into other free
   3255      programs whose distribution conditions are different, write to the
   3256      author to ask for permission.  For software which is copyrighted by
   3257      the Free Software Foundation, write to the Free Software
   3258      Foundation; we sometimes make exceptions for this.  Our decision
   3259      will be guided by the two goals of preserving the free status of
   3260      all derivatives of our free software and of promoting the sharing
   3261      and reuse of software generally.
   3262 
   3263                               NO WARRANTY
   3264 
   3265   12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
   3266      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
   3267      LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
   3268      AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
   3269      OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
   3270      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   3271      FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
   3272      PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
   3273      DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
   3274      OR CORRECTION.
   3275 
   3276   13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
   3277      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
   3278      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
   3279      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
   3280      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
   3281      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
   3282      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
   3283      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
   3284      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
   3285      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
   3286 
   3287                             ECOS EXTENSION
   3288 
   3289   14. As a special exception, if other files instantiate templates or
   3290      use macros or inline functions from this file, or you compile this
   3291      file and link it with other works to produce a work based on this
   3292      file, this file does not by itself cause the resulting work to be
   3293      covered by the GNU General Public License.  However the source code
   3294      for this file must still be made available in accordance with
   3295      section (3) of the GNU General Public License v2.
   3296 
   3297      This exception does not invalidate any other reasons why a work
   3298      based on this file might be covered by the GNU General Public
   3299      License.
   3300 
   3301 END OF TERMS AND CONDITIONS
   3302 ---------------------------
   3303 
   3304 How to Apply These Terms to Your New Programs
   3305 =============================================
   3306 
   3307 If you develop a new program, and you want it to be of the greatest
   3308 possible use to the public, the best way to achieve this is to make it
   3309 free software which everyone can redistribute and change under these
   3310 terms.
   3311 
   3312    To do so, attach the following notices to the program.  It is safest
   3313 to attach them to the start of each source file to most effectively
   3314 convey the exclusion of warranty; and each file should have at least the
   3315 "copyright" line and a pointer to where the full notice is found.
   3316 
   3317      ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
   3318      Copyright (C) 19YY  NAME OF AUTHOR
   3319 
   3320      This program is free software; you can redistribute it and/or
   3321      modify it under the terms of the GNU General Public License
   3322      as published by the Free Software Foundation; either version 2
   3323      of the License, or (at your option) any later version.
   3324 
   3325      This program is distributed in the hope that it will be useful,
   3326      but WITHOUT ANY WARRANTY; without even the implied warranty of
   3327      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   3328      GNU General Public License for more details.
   3329 
   3330      You should have received a copy of the GNU General Public License along
   3331      with this program; if not, write to the Free Software Foundation, Inc.,
   3332      59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
   3333 
   3334    Also add information on how to contact you by electronic and paper
   3335 mail.
   3336 
   3337    If the program is interactive, make it output a short notice like
   3338 this when it starts in an interactive mode:
   3339 
   3340      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
   3341      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
   3342      type `show w'.  This is free software, and you are welcome
   3343      to redistribute it under certain conditions; type `show c'
   3344      for details.
   3345 
   3346    The hypothetical commands 'show w' and 'show c' should show the
   3347 appropriate parts of the General Public License.  Of course, the
   3348 commands you use may be called something other than 'show w' and 'show
   3349 c'; they could even be mouse-clicks or menu items--whatever suits your
   3350 program.
   3351 
   3352    You should also get your employer (if you work as a programmer) or
   3353 your school, if any, to sign a "copyright disclaimer" for the program,
   3354 if necessary.  Here is a sample; alter the names:
   3355 
   3356      Yoyodyne, Inc., hereby disclaims all copyright
   3357      interest in the program `Gnomovision'
   3358      (which makes passes at compilers) written
   3359      by James Hacker.
   3360 
   3361      SIGNATURE OF TY COON, 1 April 1989
   3362      Ty Coon, President of Vice
   3363 
   3364    This General Public License does not permit incorporating your
   3365 program into proprietary programs.  If your program is a subroutine
   3366 library, you may consider it more useful to permit linking proprietary
   3367 applications with the library.  If this is what you want to do, use the
   3368 GNU Library General Public License instead of this License.
   3369 
   3370 
   3371 File: libmicrohttpd.info,  Node: GNU-FDL,  Next: Concept Index,  Prev: GNU GPL with eCos Extension,  Up: Top
   3372 
   3373 GNU-FDL
   3374 *******
   3375 
   3376                      Version 1.3, 3 November 2008
   3377 
   3378      Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
   3379      <http://fsf.org/>
   3380 
   3381      Everyone is permitted to copy and distribute verbatim copies
   3382      of this license document, but changing it is not allowed.
   3383 
   3384   0. PREAMBLE
   3385 
   3386      The purpose of this License is to make a manual, textbook, or other
   3387      functional and useful document "free" in the sense of freedom: to
   3388      assure everyone the effective freedom to copy and redistribute it,
   3389      with or without modifying it, either commercially or
   3390      noncommercially.  Secondarily, this License preserves for the
   3391      author and publisher a way to get credit for their work, while not
   3392      being considered responsible for modifications made by others.
   3393 
   3394      This License is a kind of "copyleft", which means that derivative
   3395      works of the document must themselves be free in the same sense.
   3396      It complements the GNU General Public License, which is a copyleft
   3397      license designed for free software.
   3398 
   3399      We have designed this License in order to use it for manuals for
   3400      free software, because free software needs free documentation: a
   3401      free program should come with manuals providing the same freedoms
   3402      that the software does.  But this License is not limited to
   3403      software manuals; it can be used for any textual work, regardless
   3404      of subject matter or whether it is published as a printed book.  We
   3405      recommend this License principally for works whose purpose is
   3406      instruction or reference.
   3407 
   3408   1. APPLICABILITY AND DEFINITIONS
   3409 
   3410      This License applies to any manual or other work, in any medium,
   3411      that contains a notice placed by the copyright holder saying it can
   3412      be distributed under the terms of this License.  Such a notice
   3413      grants a world-wide, royalty-free license, unlimited in duration,
   3414      to use that work under the conditions stated herein.  The
   3415      "Document", below, refers to any such manual or work.  Any member
   3416      of the public is a licensee, and is addressed as "you".  You accept
   3417      the license if you copy, modify or distribute the work in a way
   3418      requiring permission under copyright law.
   3419 
   3420      A "Modified Version" of the Document means any work containing the
   3421      Document or a portion of it, either copied verbatim, or with
   3422      modifications and/or translated into another language.
   3423 
   3424      A "Secondary Section" is a named appendix or a front-matter section
   3425      of the Document that deals exclusively with the relationship of the
   3426      publishers or authors of the Document to the Document's overall
   3427      subject (or to related matters) and contains nothing that could
   3428      fall directly within that overall subject.  (Thus, if the Document
   3429      is in part a textbook of mathematics, a Secondary Section may not
   3430      explain any mathematics.)  The relationship could be a matter of
   3431      historical connection with the subject or with related matters, or
   3432      of legal, commercial, philosophical, ethical or political position
   3433      regarding them.
   3434 
   3435      The "Invariant Sections" are certain Secondary Sections whose
   3436      titles are designated, as being those of Invariant Sections, in the
   3437      notice that says that the Document is released under this License.
   3438      If a section does not fit the above definition of Secondary then it
   3439      is not allowed to be designated as Invariant.  The Document may
   3440      contain zero Invariant Sections.  If the Document does not identify
   3441      any Invariant Sections then there are none.
   3442 
   3443      The "Cover Texts" are certain short passages of text that are
   3444      listed, as Front-Cover Texts or Back-Cover Texts, in the notice
   3445      that says that the Document is released under this License.  A
   3446      Front-Cover Text may be at most 5 words, and a Back-Cover Text may
   3447      be at most 25 words.
   3448 
   3449      A "Transparent" copy of the Document means a machine-readable copy,
   3450      represented in a format whose specification is available to the
   3451      general public, that is suitable for revising the document
   3452      straightforwardly with generic text editors or (for images composed
   3453      of pixels) generic paint programs or (for drawings) some widely
   3454      available drawing editor, and that is suitable for input to text
   3455      formatters or for automatic translation to a variety of formats
   3456      suitable for input to text formatters.  A copy made in an otherwise
   3457      Transparent file format whose markup, or absence of markup, has
   3458      been arranged to thwart or discourage subsequent modification by
   3459      readers is not Transparent.  An image format is not Transparent if
   3460      used for any substantial amount of text.  A copy that is not
   3461      "Transparent" is called "Opaque".
   3462 
   3463      Examples of suitable formats for Transparent copies include plain
   3464      ASCII without markup, Texinfo input format, LaTeX input format,
   3465      SGML or XML using a publicly available DTD, and standard-conforming
   3466      simple HTML, PostScript or PDF designed for human modification.
   3467      Examples of transparent image formats include PNG, XCF and JPG.
   3468      Opaque formats include proprietary formats that can be read and
   3469      edited only by proprietary word processors, SGML or XML for which
   3470      the DTD and/or processing tools are not generally available, and
   3471      the machine-generated HTML, PostScript or PDF produced by some word
   3472      processors for output purposes only.
   3473 
   3474      The "Title Page" means, for a printed book, the title page itself,
   3475      plus such following pages as are needed to hold, legibly, the
   3476      material this License requires to appear in the title page.  For
   3477      works in formats which do not have any title page as such, "Title
   3478      Page" means the text near the most prominent appearance of the
   3479      work's title, preceding the beginning of the body of the text.
   3480 
   3481      The "publisher" means any person or entity that distributes copies
   3482      of the Document to the public.
   3483 
   3484      A section "Entitled XYZ" means a named subunit of the Document
   3485      whose title either is precisely XYZ or contains XYZ in parentheses
   3486      following text that translates XYZ in another language.  (Here XYZ
   3487      stands for a specific section name mentioned below, such as
   3488      "Acknowledgements", "Dedications", "Endorsements", or "History".)
   3489      To "Preserve the Title" of such a section when you modify the
   3490      Document means that it remains a section "Entitled XYZ" according
   3491      to this definition.
   3492 
   3493      The Document may include Warranty Disclaimers next to the notice
   3494      which states that this License applies to the Document.  These
   3495      Warranty Disclaimers are considered to be included by reference in
   3496      this License, but only as regards disclaiming warranties: any other
   3497      implication that these Warranty Disclaimers may have is void and
   3498      has no effect on the meaning of this License.
   3499 
   3500   2. VERBATIM COPYING
   3501 
   3502      You may copy and distribute the Document in any medium, either
   3503      commercially or noncommercially, provided that this License, the
   3504      copyright notices, and the license notice saying this License
   3505      applies to the Document are reproduced in all copies, and that you
   3506      add no other conditions whatsoever to those of this License.  You
   3507      may not use technical measures to obstruct or control the reading
   3508      or further copying of the copies you make or distribute.  However,
   3509      you may accept compensation in exchange for copies.  If you
   3510      distribute a large enough number of copies you must also follow the
   3511      conditions in section 3.
   3512 
   3513      You may also lend copies, under the same conditions stated above,
   3514      and you may publicly display copies.
   3515 
   3516   3. COPYING IN QUANTITY
   3517 
   3518      If you publish printed copies (or copies in media that commonly
   3519      have printed covers) of the Document, numbering more than 100, and
   3520      the Document's license notice requires Cover Texts, you must
   3521      enclose the copies in covers that carry, clearly and legibly, all
   3522      these Cover Texts: Front-Cover Texts on the front cover, and
   3523      Back-Cover Texts on the back cover.  Both covers must also clearly
   3524      and legibly identify you as the publisher of these copies.  The
   3525      front cover must present the full title with all words of the title
   3526      equally prominent and visible.  You may add other material on the
   3527      covers in addition.  Copying with changes limited to the covers, as
   3528      long as they preserve the title of the Document and satisfy these
   3529      conditions, can be treated as verbatim copying in other respects.
   3530 
   3531      If the required texts for either cover are too voluminous to fit
   3532      legibly, you should put the first ones listed (as many as fit
   3533      reasonably) on the actual cover, and continue the rest onto
   3534      adjacent pages.
   3535 
   3536      If you publish or distribute Opaque copies of the Document
   3537      numbering more than 100, you must either include a machine-readable
   3538      Transparent copy along with each Opaque copy, or state in or with
   3539      each Opaque copy a computer-network location from which the general
   3540      network-using public has access to download using public-standard
   3541      network protocols a complete Transparent copy of the Document, free
   3542      of added material.  If you use the latter option, you must take
   3543      reasonably prudent steps, when you begin distribution of Opaque
   3544      copies in quantity, to ensure that this Transparent copy will
   3545      remain thus accessible at the stated location until at least one
   3546      year after the last time you distribute an Opaque copy (directly or
   3547      through your agents or retailers) of that edition to the public.
   3548 
   3549      It is requested, but not required, that you contact the authors of
   3550      the Document well before redistributing any large number of copies,
   3551      to give them a chance to provide you with an updated version of the
   3552      Document.
   3553 
   3554   4. MODIFICATIONS
   3555 
   3556      You may copy and distribute a Modified Version of the Document
   3557      under the conditions of sections 2 and 3 above, provided that you
   3558      release the Modified Version under precisely this License, with the
   3559      Modified Version filling the role of the Document, thus licensing
   3560      distribution and modification of the Modified Version to whoever
   3561      possesses a copy of it.  In addition, you must do these things in
   3562      the Modified Version:
   3563 
   3564        A. Use in the Title Page (and on the covers, if any) a title
   3565           distinct from that of the Document, and from those of previous
   3566           versions (which should, if there were any, be listed in the
   3567           History section of the Document).  You may use the same title
   3568           as a previous version if the original publisher of that
   3569           version gives permission.
   3570 
   3571        B. List on the Title Page, as authors, one or more persons or
   3572           entities responsible for authorship of the modifications in
   3573           the Modified Version, together with at least five of the
   3574           principal authors of the Document (all of its principal
   3575           authors, if it has fewer than five), unless they release you
   3576           from this requirement.
   3577 
   3578        C. State on the Title page the name of the publisher of the
   3579           Modified Version, as the publisher.
   3580 
   3581        D. Preserve all the copyright notices of the Document.
   3582 
   3583        E. Add an appropriate copyright notice for your modifications
   3584           adjacent to the other copyright notices.
   3585 
   3586        F. Include, immediately after the copyright notices, a license
   3587           notice giving the public permission to use the Modified
   3588           Version under the terms of this License, in the form shown in
   3589           the Addendum below.
   3590 
   3591        G. Preserve in that license notice the full lists of Invariant
   3592           Sections and required Cover Texts given in the Document's
   3593           license notice.
   3594 
   3595        H. Include an unaltered copy of this License.
   3596 
   3597        I. Preserve the section Entitled "History", Preserve its Title,
   3598           and add to it an item stating at least the title, year, new
   3599           authors, and publisher of the Modified Version as given on the
   3600           Title Page.  If there is no section Entitled "History" in the
   3601           Document, create one stating the title, year, authors, and
   3602           publisher of the Document as given on its Title Page, then add
   3603           an item describing the Modified Version as stated in the
   3604           previous sentence.
   3605 
   3606        J. Preserve the network location, if any, given in the Document
   3607           for public access to a Transparent copy of the Document, and
   3608           likewise the network locations given in the Document for
   3609           previous versions it was based on.  These may be placed in the
   3610           "History" section.  You may omit a network location for a work
   3611           that was published at least four years before the Document
   3612           itself, or if the original publisher of the version it refers
   3613           to gives permission.
   3614 
   3615        K. For any section Entitled "Acknowledgements" or "Dedications",
   3616           Preserve the Title of the section, and preserve in the section
   3617           all the substance and tone of each of the contributor
   3618           acknowledgements and/or dedications given therein.
   3619 
   3620        L. Preserve all the Invariant Sections of the Document, unaltered
   3621           in their text and in their titles.  Section numbers or the
   3622           equivalent are not considered part of the section titles.
   3623 
   3624        M. Delete any section Entitled "Endorsements".  Such a section
   3625           may not be included in the Modified Version.
   3626 
   3627        N. Do not retitle any existing section to be Entitled
   3628           "Endorsements" or to conflict in title with any Invariant
   3629           Section.
   3630 
   3631        O. Preserve any Warranty Disclaimers.
   3632 
   3633      If the Modified Version includes new front-matter sections or
   3634      appendices that qualify as Secondary Sections and contain no
   3635      material copied from the Document, you may at your option designate
   3636      some or all of these sections as invariant.  To do this, add their
   3637      titles to the list of Invariant Sections in the Modified Version's
   3638      license notice.  These titles must be distinct from any other
   3639      section titles.
   3640 
   3641      You may add a section Entitled "Endorsements", provided it contains
   3642      nothing but endorsements of your Modified Version by various
   3643      parties--for example, statements of peer review or that the text
   3644      has been approved by an organization as the authoritative
   3645      definition of a standard.
   3646 
   3647      You may add a passage of up to five words as a Front-Cover Text,
   3648      and a passage of up to 25 words as a Back-Cover Text, to the end of
   3649      the list of Cover Texts in the Modified Version.  Only one passage
   3650      of Front-Cover Text and one of Back-Cover Text may be added by (or
   3651      through arrangements made by) any one entity.  If the Document
   3652      already includes a cover text for the same cover, previously added
   3653      by you or by arrangement made by the same entity you are acting on
   3654      behalf of, you may not add another; but you may replace the old
   3655      one, on explicit permission from the previous publisher that added
   3656      the old one.
   3657 
   3658      The author(s) and publisher(s) of the Document do not by this
   3659      License give permission to use their names for publicity for or to
   3660      assert or imply endorsement of any Modified Version.
   3661 
   3662   5. COMBINING DOCUMENTS
   3663 
   3664      You may combine the Document with other documents released under
   3665      this License, under the terms defined in section 4 above for
   3666      modified versions, provided that you include in the combination all
   3667      of the Invariant Sections of all of the original documents,
   3668      unmodified, and list them all as Invariant Sections of your
   3669      combined work in its license notice, and that you preserve all
   3670      their Warranty Disclaimers.
   3671 
   3672      The combined work need only contain one copy of this License, and
   3673      multiple identical Invariant Sections may be replaced with a single
   3674      copy.  If there are multiple Invariant Sections with the same name
   3675      but different contents, make the title of each such section unique
   3676      by adding at the end of it, in parentheses, the name of the
   3677      original author or publisher of that section if known, or else a
   3678      unique number.  Make the same adjustment to the section titles in
   3679      the list of Invariant Sections in the license notice of the
   3680      combined work.
   3681 
   3682      In the combination, you must combine any sections Entitled
   3683      "History" in the various original documents, forming one section
   3684      Entitled "History"; likewise combine any sections Entitled
   3685      "Acknowledgements", and any sections Entitled "Dedications".  You
   3686      must delete all sections Entitled "Endorsements."
   3687 
   3688   6. COLLECTIONS OF DOCUMENTS
   3689 
   3690      You may make a collection consisting of the Document and other
   3691      documents released under this License, and replace the individual
   3692      copies of this License in the various documents with a single copy
   3693      that is included in the collection, provided that you follow the
   3694      rules of this License for verbatim copying of each of the documents
   3695      in all other respects.
   3696 
   3697      You may extract a single document from such a collection, and
   3698      distribute it individually under this License, provided you insert
   3699      a copy of this License into the extracted document, and follow this
   3700      License in all other respects regarding verbatim copying of that
   3701      document.
   3702 
   3703   7. AGGREGATION WITH INDEPENDENT WORKS
   3704 
   3705      A compilation of the Document or its derivatives with other
   3706      separate and independent documents or works, in or on a volume of a
   3707      storage or distribution medium, is called an "aggregate" if the
   3708      copyright resulting from the compilation is not used to limit the
   3709      legal rights of the compilation's users beyond what the individual
   3710      works permit.  When the Document is included in an aggregate, this
   3711      License does not apply to the other works in the aggregate which
   3712      are not themselves derivative works of the Document.
   3713 
   3714      If the Cover Text requirement of section 3 is applicable to these
   3715      copies of the Document, then if the Document is less than one half
   3716      of the entire aggregate, the Document's Cover Texts may be placed
   3717      on covers that bracket the Document within the aggregate, or the
   3718      electronic equivalent of covers if the Document is in electronic
   3719      form.  Otherwise they must appear on printed covers that bracket
   3720      the whole aggregate.
   3721 
   3722   8. TRANSLATION
   3723 
   3724      Translation is considered a kind of modification, so you may
   3725      distribute translations of the Document under the terms of section
   3726      4.  Replacing Invariant Sections with translations requires special
   3727      permission from their copyright holders, but you may include
   3728      translations of some or all Invariant Sections in addition to the
   3729      original versions of these Invariant Sections.  You may include a
   3730      translation of this License, and all the license notices in the
   3731      Document, and any Warranty Disclaimers, provided that you also
   3732      include the original English version of this License and the
   3733      original versions of those notices and disclaimers.  In case of a
   3734      disagreement between the translation and the original version of
   3735      this License or a notice or disclaimer, the original version will
   3736      prevail.
   3737 
   3738      If a section in the Document is Entitled "Acknowledgements",
   3739      "Dedications", or "History", the requirement (section 4) to
   3740      Preserve its Title (section 1) will typically require changing the
   3741      actual title.
   3742 
   3743   9. TERMINATION
   3744 
   3745      You may not copy, modify, sublicense, or distribute the Document
   3746      except as expressly provided under this License.  Any attempt
   3747      otherwise to copy, modify, sublicense, or distribute it is void,
   3748      and will automatically terminate your rights under this License.
   3749 
   3750      However, if you cease all violation of this License, then your
   3751      license from a particular copyright holder is reinstated (a)
   3752      provisionally, unless and until the copyright holder explicitly and
   3753      finally terminates your license, and (b) permanently, if the
   3754      copyright holder fails to notify you of the violation by some
   3755      reasonable means prior to 60 days after the cessation.
   3756 
   3757      Moreover, your license from a particular copyright holder is
   3758      reinstated permanently if the copyright holder notifies you of the
   3759      violation by some reasonable means, this is the first time you have
   3760      received notice of violation of this License (for any work) from
   3761      that copyright holder, and you cure the violation prior to 30 days
   3762      after your receipt of the notice.
   3763 
   3764      Termination of your rights under this section does not terminate
   3765      the licenses of parties who have received copies or rights from you
   3766      under this License.  If your rights have been terminated and not
   3767      permanently reinstated, receipt of a copy of some or all of the
   3768      same material does not give you any rights to use it.
   3769 
   3770   10. FUTURE REVISIONS OF THIS LICENSE
   3771 
   3772      The Free Software Foundation may publish new, revised versions of
   3773      the GNU Free Documentation License from time to time.  Such new
   3774      versions will be similar in spirit to the present version, but may
   3775      differ in detail to address new problems or concerns.  See
   3776      <http://www.gnu.org/copyleft/>.
   3777 
   3778      Each version of the License is given a distinguishing version
   3779      number.  If the Document specifies that a particular numbered
   3780      version of this License "or any later version" applies to it, you
   3781      have the option of following the terms and conditions either of
   3782      that specified version or of any later version that has been
   3783      published (not as a draft) by the Free Software Foundation.  If the
   3784      Document does not specify a version number of this License, you may
   3785      choose any version ever published (not as a draft) by the Free
   3786      Software Foundation.  If the Document specifies that a proxy can
   3787      decide which future versions of this License can be used, that
   3788      proxy's public statement of acceptance of a version permanently
   3789      authorizes you to choose that version for the Document.
   3790 
   3791   11. RELICENSING
   3792 
   3793      "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
   3794      World Wide Web server that publishes copyrightable works and also
   3795      provides prominent facilities for anybody to edit those works.  A
   3796      public wiki that anybody can edit is an example of such a server.
   3797      A "Massive Multiauthor Collaboration" (or "MMC") contained in the
   3798      site means any set of copyrightable works thus published on the MMC
   3799      site.
   3800 
   3801      "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
   3802      license published by Creative Commons Corporation, a not-for-profit
   3803      corporation with a principal place of business in San Francisco,
   3804      California, as well as future copyleft versions of that license
   3805      published by that same organization.
   3806 
   3807      "Incorporate" means to publish or republish a Document, in whole or
   3808      in part, as part of another Document.
   3809 
   3810      An MMC is "eligible for relicensing" if it is licensed under this
   3811      License, and if all works that were first published under this
   3812      License somewhere other than this MMC, and subsequently
   3813      incorporated in whole or in part into the MMC, (1) had no cover
   3814      texts or invariant sections, and (2) were thus incorporated prior
   3815      to November 1, 2008.
   3816 
   3817      The operator of an MMC Site may republish an MMC contained in the
   3818      site under CC-BY-SA on the same site at any time before August 1,
   3819      2009, provided the MMC is eligible for relicensing.
   3820 
   3821 ADDENDUM: How to use this License for your documents
   3822 ====================================================
   3823 
   3824 To use this License in a document you have written, include a copy of
   3825 the License in the document and put the following copyright and license
   3826 notices just after the title page:
   3827 
   3828        Copyright (C)  YEAR  YOUR NAME.
   3829        Permission is granted to copy, distribute and/or modify this document
   3830        under the terms of the GNU Free Documentation License, Version 1.3
   3831        or any later version published by the Free Software Foundation;
   3832        with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
   3833        Texts.  A copy of the license is included in the section entitled ``GNU
   3834        Free Documentation License''.
   3835 
   3836    If you have Invariant Sections, Front-Cover Texts and Back-Cover
   3837 Texts, replace the "with...Texts."  line with this:
   3838 
   3839          with the Invariant Sections being LIST THEIR TITLES, with
   3840          the Front-Cover Texts being LIST, and with the Back-Cover Texts
   3841          being LIST.
   3842 
   3843    If you have Invariant Sections without Cover Texts, or some other
   3844 combination of the three, merge those two alternatives to suit the
   3845 situation.
   3846 
   3847    If your document contains nontrivial examples of program code, we
   3848 recommend releasing these examples in parallel under your choice of free
   3849 software license, such as the GNU General Public License, to permit
   3850 their use in free software.
   3851 
   3852 
   3853 File: libmicrohttpd.info,  Node: Concept Index,  Next: Function and Data Index,  Prev: GNU-FDL,  Up: Top
   3854 
   3855 Concept Index
   3856 *************
   3857 
   3858 [index]
   3859 * Menu:
   3860 
   3861 * ARM:                                   microhttpd-intro.    (line 249)
   3862 * bind, restricting bind:                microhttpd-const.    (line 226)
   3863 * bind, restricting bind <1>:            microhttpd-const.    (line 445)
   3864 * cipher:                                microhttpd-const.    (line 299)
   3865 * clock:                                 microhttpd-const.    (line  88)
   3866 * compilation:                           microhttpd-intro.    (line 107)
   3867 * connection, limiting number of connections: microhttpd-const.
   3868                                                               (line 150)
   3869 * connection, limiting number of connections <1>: microhttpd-info daemon.
   3870                                                               (line  60)
   3871 * cookie:                                microhttpd-const.    (line 481)
   3872 * cortex m3:                             microhttpd-intro.    (line 249)
   3873 * date:                                  microhttpd-const.    (line  88)
   3874 * debugging:                             microhttpd-const.    (line  24)
   3875 * debugging <1>:                         microhttpd-const.    (line 237)
   3876 * DH:                                    microhttpd-const.    (line 437)
   3877 * digest auth:                           microhttpd-const.    (line 322)
   3878 * digest auth <1>:                       microhttpd-const.    (line 333)
   3879 * eCos, GNU General Public License with eCos Extension: GNU GPL with eCos Extension.
   3880                                                               (line   6)
   3881 * embedded systems:                      microhttpd-intro.    (line 107)
   3882 * embedded systems <1>:                  microhttpd-intro.    (line 249)
   3883 * embedded systems <2>:                  microhttpd-const.    (line  88)
   3884 * embedded systems <3>:                  microhttpd-const.    (line  95)
   3885 * embedded systems <4>:                  microhttpd-const.    (line 421)
   3886 * epoll:                                 microhttpd-intro.    (line  55)
   3887 * epoll <1>:                             microhttpd-const.    (line  76)
   3888 * epoll <2>:                             microhttpd-info daemon.
   3889                                                               (line  49)
   3890 * escaping:                              microhttpd-const.    (line 404)
   3891 * FD_SETSIZE:                            microhttpd-const.    (line  68)
   3892 * FD_SETSIZE <1>:                        microhttpd-const.    (line  76)
   3893 * foreign-function interface:            microhttpd-const.    (line 382)
   3894 * GPL, GNU General Public License:       GNU GPL with eCos Extension.
   3895                                                               (line   6)
   3896 * IAR:                                   microhttpd-intro.    (line 249)
   3897 * internationalization:                  microhttpd-const.    (line 404)
   3898 * IPv6:                                  microhttpd-const.    (line  43)
   3899 * IPv6 <1>:                              microhttpd-const.    (line  53)
   3900 * license:                               GNU-LGPL.            (line   6)
   3901 * license <1>:                           GNU GPL with eCos Extension.
   3902                                                               (line   6)
   3903 * license <2>:                           GNU-FDL.             (line   6)
   3904 * listen:                                microhttpd-const.    (line  95)
   3905 * listen <1>:                            microhttpd-const.    (line 121)
   3906 * listen <2>:                            microhttpd-const.    (line 427)
   3907 * listen <3>:                            microhttpd-info daemon.
   3908                                                               (line  43)
   3909 * logging:                               microhttpd-const.    (line 237)
   3910 * logging <1>:                           microhttpd-const.    (line 363)
   3911 * long long:                             microhttpd-intro.    (line 249)
   3912 * memory:                                microhttpd-const.    (line 142)
   3913 * memory, limiting memory utilization:   microhttpd-const.    (line 134)
   3914 * MHD_LONG_LONG:                         microhttpd-intro.    (line 249)
   3915 * microhttpd.h:                          microhttpd-intro.    (line 189)
   3916 * options:                               microhttpd-const.    (line 382)
   3917 * performance:                           microhttpd-intro.    (line  77)
   3918 * performance <1>:                       microhttpd-const.    (line 374)
   3919 * poll:                                  microhttpd-intro.    (line  55)
   3920 * poll <1>:                              microhttpd-const.    (line  68)
   3921 * poll <2>:                              microhttpd-init.     (line  74)
   3922 * portability:                           microhttpd-intro.    (line 107)
   3923 * portability <1>:                       microhttpd-intro.    (line 189)
   3924 * POST method:                           microhttpd-const.    (line 485)
   3925 * POST method <1>:                       microhttpd-struct.   (line  19)
   3926 * POST method <2>:                       microhttpd-cb.       (line  48)
   3927 * POST method <3>:                       microhttpd-post.     (line   6)
   3928 * POST method <4>:                       microhttpd-post api. (line   6)
   3929 * proxy:                                 microhttpd-const.    (line  95)
   3930 * pthread:                               microhttpd-const.    (line 421)
   3931 * PUT method:                            microhttpd-cb.       (line  48)
   3932 * query string:                          microhttpd-const.    (line 237)
   3933 * quiesce:                               microhttpd-const.    (line 102)
   3934 * quiesce <1>:                           microhttpd-init.     (line  51)
   3935 * random:                                microhttpd-const.    (line 322)
   3936 * replay attack:                         microhttpd-const.    (line 333)
   3937 * reusing listening address:             microhttpd-const.    (line 445)
   3938 * select:                                microhttpd-intro.    (line  55)
   3939 * select <1>:                            microhttpd-const.    (line  68)
   3940 * select <2>:                            microhttpd-const.    (line  76)
   3941 * select <3>:                            microhttpd-init.     (line  74)
   3942 * select <4>:                            microhttpd-init.     (line  89)
   3943 * signals:                               microhttpd-intro.    (line 210)
   3944 * SNI:                                   microhttpd-const.    (line 307)
   3945 * SSL:                                   microhttpd-const.    (line  32)
   3946 * SSL <1>:                               microhttpd-const.    (line 260)
   3947 * SSL <2>:                               microhttpd-const.    (line 266)
   3948 * SSL <3>:                               microhttpd-const.    (line 276)
   3949 * SSL <4>:                               microhttpd-const.    (line 282)
   3950 * SSL <5>:                               microhttpd-const.    (line 294)
   3951 * SSL <6>:                               microhttpd-const.    (line 299)
   3952 * SSL <7>:                               microhttpd-const.    (line 307)
   3953 * SSL <8>:                               microhttpd-const.    (line 437)
   3954 * stack:                                 microhttpd-const.    (line 421)
   3955 * systemd:                               microhttpd-const.    (line 356)
   3956 * thread:                                microhttpd-const.    (line 421)
   3957 * timeout:                               microhttpd-const.    (line 178)
   3958 * timeout <1>:                           microhttpd-inspect.  (line  24)
   3959 * timeout <2>:                           microhttpd-option conn.
   3960                                                               (line   6)
   3961 * TLS:                                   microhttpd-const.    (line  32)
   3962 * TLS <1>:                               microhttpd-const.    (line 260)
   3963 * TLS <2>:                               microhttpd-const.    (line 266)
   3964 * TLS <3>:                               microhttpd-const.    (line 276)
   3965 * TLS <4>:                               microhttpd-const.    (line 282)
   3966 * TLS <5>:                               microhttpd-const.    (line 294)
   3967 * TLS <6>:                               microhttpd-const.    (line 299)
   3968 * TLS <7>:                               microhttpd-const.    (line 307)
   3969 * TLS <8>:                               microhttpd-const.    (line 437)
   3970 
   3971 
   3972 File: libmicrohttpd.info,  Node: Function and Data Index,  Next: Type Index,  Prev: Concept Index,  Up: Top
   3973 
   3974 Function and Data Index
   3975 ***********************
   3976 
   3977 [index]
   3978 * Menu:
   3979 
   3980 * *MHD_AcceptPolicyCallback:             microhttpd-cb.       (line   6)
   3981 * *MHD_AccessHandlerCallback:            microhttpd-cb.       (line  19)
   3982 * *MHD_ContentReaderCallback:            microhttpd-cb.       (line 138)
   3983 * *MHD_ContentReaderFreeCallback:        microhttpd-cb.       (line 185)
   3984 * *MHD_KeyValueIterator:                 microhttpd-cb.       (line 116)
   3985 * *MHD_PostDataIterator:                 microhttpd-cb.       (line 190)
   3986 * *MHD_RequestCompletedCallback:         microhttpd-cb.       (line  96)
   3987 * MHD_add_connection:                    microhttpd-init.     (line 115)
   3988 * MHD_add_response_footer:               microhttpd-response headers.
   3989                                                               (line  18)
   3990 * MHD_add_response_header:               microhttpd-response headers.
   3991                                                               (line   6)
   3992 * MHD_basic_auth_get_username_password:  microhttpd-dauth basic.
   3993                                                               (line   6)
   3994 * MHD_create_post_processor:             microhttpd-post api. (line   6)
   3995 * MHD_create_response_from_buffer:       microhttpd-response create.
   3996                                                               (line  92)
   3997 * MHD_create_response_from_callback:     microhttpd-response create.
   3998                                                               (line   6)
   3999 * MHD_create_response_from_data:         microhttpd-response create.
   4000                                                               (line 113)
   4001 * MHD_create_response_from_fd:           microhttpd-response create.
   4002                                                               (line  32)
   4003 * MHD_create_response_from_fd_at_offset: microhttpd-response create.
   4004                                                               (line  50)
   4005 * MHD_del_response_header:               microhttpd-response headers.
   4006                                                               (line  34)
   4007 * MHD_destroy_post_processor:            microhttpd-post api. (line  52)
   4008 * MHD_destroy_response:                  microhttpd-response enqueue.
   4009                                                               (line  28)
   4010 * MHD_digest_auth_check:                 microhttpd-dauth digest.
   4011                                                               (line  13)
   4012 * MHD_digest_auth_get_username:          microhttpd-dauth digest.
   4013                                                               (line   6)
   4014 * MHD_get_connection_info:               microhttpd-info conn.
   4015                                                               (line   6)
   4016 * MHD_get_connection_values:             microhttpd-requests. (line   6)
   4017 * MHD_get_daemon_info:                   microhttpd-info daemon.
   4018                                                               (line   6)
   4019 * MHD_get_fdset:                         microhttpd-inspect.  (line   6)
   4020 * MHD_get_response_header:               microhttpd-response inspect.
   4021                                                               (line  18)
   4022 * MHD_get_response_headers:              microhttpd-response inspect.
   4023                                                               (line   6)
   4024 * MHD_get_timeout:                       microhttpd-inspect.  (line  22)
   4025 * MHD_http_unescape:                     microhttpd-util unescape.
   4026                                                               (line   6)
   4027 * MHD_is_feature_supported:              microhttpd-util feature.
   4028                                                               (line  75)
   4029 * MHD_lookup_connection_value:           microhttpd-requests. (line  56)
   4030 * MHD_post_process:                      microhttpd-post api. (line  33)
   4031 * MHD_queue_auth_fail_response:          microhttpd-dauth digest.
   4032                                                               (line  35)
   4033 * MHD_queue_basic_auth_fail_response:    microhttpd-dauth basic.
   4034                                                               (line  17)
   4035 * MHD_queue_response:                    microhttpd-response enqueue.
   4036                                                               (line   6)
   4037 * MHD_quiesce_daemon:                    microhttpd-init.     (line  50)
   4038 * MHD_resume_connection:                 microhttpd-flow.     (line  49)
   4039 * MHD_run:                               microhttpd-init.     (line  70)
   4040 * MHD_run_from_select:                   microhttpd-init.     (line  86)
   4041 * MHD_set_connection_option:             microhttpd-option conn.
   4042                                                               (line   6)
   4043 * MHD_set_connection_value:              microhttpd-requests. (line  33)
   4044 * MHD_set_panic_func:                    microhttpd-init.     (line   6)
   4045 * MHD_set_response_options:              microhttpd-response options.
   4046                                                               (line   6)
   4047 * MHD_start_daemon:                      microhttpd-init.     (line  18)
   4048 * MHD_stop_daemon:                       microhttpd-init.     (line  67)
   4049 * MHD_suspend_connection:                microhttpd-flow.     (line  20)
   4050 
   4051 
   4052 File: libmicrohttpd.info,  Node: Type Index,  Prev: Function and Data Index,  Up: Top
   4053 
   4054 Type Index
   4055 **********
   4056 
   4057 [index]
   4058 * Menu:
   4059 
   4060 * MHD_Connection:                        microhttpd-struct.   (line   9)
   4061 * MHD_ConnectionInfo:                    microhttpd-struct.   (line  21)
   4062 * MHD_ConnectionInfoType:                microhttpd-info conn.
   4063                                                               (line  25)
   4064 * MHD_CONNECTION_OPTION:                 microhttpd-option conn.
   4065                                                               (line  22)
   4066 * MHD_Daemon:                            microhttpd-struct.   (line   6)
   4067 * MHD_DaemonInfo:                        microhttpd-struct.   (line  24)
   4068 * MHD_DaemonInfoType:                    microhttpd-info daemon.
   4069                                                               (line  25)
   4070 * MHD_FEATURE:                           microhttpd-util feature.
   4071                                                               (line   6)
   4072 * MHD_FLAG:                              microhttpd-const.    (line   6)
   4073 * MHD_OPTION:                            microhttpd-const.    (line 125)
   4074 * MHD_OptionItem:                        microhttpd-const.    (line 457)
   4075 * MHD_PostProcessor:                     microhttpd-struct.   (line  18)
   4076 * MHD_RequestTerminationCode:            microhttpd-const.    (line 498)
   4077 * MHD_Response:                          microhttpd-struct.   (line  15)
   4078 * MHD_ResponseFlags:                     microhttpd-const.    (line 538)
   4079 * MHD_ResponseMemoryMode:                microhttpd-const.    (line 516)
   4080 * MHD_ResponseOptions:                   microhttpd-const.    (line 550)
   4081 * MHD_ValueKind:                         microhttpd-const.    (line 470)
   4082 
   4083 
   4084 
   4085 Tag Table:
   4086 Node: Top813
   4087 Node: microhttpd-intro3014
   4088 Ref: fig:performance7063
   4089 Ref: tbl:supported8008
   4090 Node: microhttpd-const15281
   4091 Node: microhttpd-struct42798
   4092 Node: microhttpd-cb43578
   4093 Node: microhttpd-init52920
   4094 Node: microhttpd-inspect58674
   4095 Node: microhttpd-requests60611
   4096 Node: microhttpd-responses64095
   4097 Node: microhttpd-response enqueue65207
   4098 Ref: microhttpd-response enqueue-Footnote-167474
   4099 Node: microhttpd-response create67693
   4100 Node: microhttpd-response headers73726
   4101 Node: microhttpd-response options75553
   4102 Node: microhttpd-response inspect76408
   4103 Node: microhttpd-flow77581
   4104 Node: microhttpd-dauth80172
   4105 Node: microhttpd-dauth basic81723
   4106 Node: microhttpd-dauth digest82915
   4107 Node: microhttpd-post87563
   4108 Node: microhttpd-post api90508
   4109 Node: microhttpd-info93092
   4110 Node: microhttpd-info daemon93514
   4111 Node: microhttpd-info conn96919
   4112 Node: microhttpd-option conn100636
   4113 Node: microhttpd-util101700
   4114 Node: microhttpd-util feature101971
   4115 Node: microhttpd-util unescape105412
   4116 Node: GNU-LGPL106052
   4117 Node: GNU GPL with eCos Extension134156
   4118 Node: GNU-FDL154024
   4119 Node: Concept Index179110
   4120 Node: Function and Data Index187200
   4121 Node: Type Index192372
   4122 
   4123 End Tag Table
   4124