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