diff options
Diffstat (limited to 'doc/libmicrohttpd.texi')
-rw-r--r-- | doc/libmicrohttpd.texi | 239 |
1 files changed, 151 insertions, 88 deletions
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi index 3ff8c2ac..e18c3014 100644 --- a/doc/libmicrohttpd.texi +++ b/doc/libmicrohttpd.texi | |||
@@ -63,6 +63,7 @@ Free Documentation License". | |||
63 | * microhttpd-inspect:: Implementing external @code{select}. | 63 | * microhttpd-inspect:: Implementing external @code{select}. |
64 | * microhttpd-requests:: Handling requests. | 64 | * microhttpd-requests:: Handling requests. |
65 | * microhttpd-responses:: Building responses to requests. | 65 | * microhttpd-responses:: Building responses to requests. |
66 | * microhttpd-flow:: Flow control. | ||
66 | * microhttpd-dauth:: Utilizing Authentication. | 67 | * microhttpd-dauth:: Utilizing Authentication. |
67 | * microhttpd-post:: Adding a @code{POST} processor. | 68 | * microhttpd-post:: Adding a @code{POST} processor. |
68 | * microhttpd-info:: Obtaining and modifying status information. | 69 | * microhttpd-info:: Obtaining and modifying status information. |
@@ -132,7 +133,7 @@ used per connection to avoid resource exhaustion. | |||
132 | 133 | ||
133 | @section Scope | 134 | @section Scope |
134 | 135 | ||
135 | MHD is currently used in a wide range of implementations. | 136 | MHD is currently used in a wide range of implementations. |
136 | Examples based on reports we've received from developers include: | 137 | Examples based on reports we've received from developers include: |
137 | @itemize | 138 | @itemize |
138 | @item Embedded HTTP server on a cortex M3 (128 KB code space) | 139 | @item Embedded HTTP server on a cortex M3 (128 KB code space) |
@@ -148,7 +149,7 @@ Examples based on reports we've received from developers include: | |||
148 | @cindex select | 149 | @cindex select |
149 | 150 | ||
150 | MHD supports four basic thread modes and up to three event loop | 151 | MHD supports four basic thread modes and up to three event loop |
151 | styes. | 152 | styes. |
152 | 153 | ||
153 | The four basic thread modes are external (MHD creates no threads, | 154 | The four basic thread modes are external (MHD creates no threads, |
154 | event loop is fully managed by the application), internal (MHD creates | 155 | event loop is fully managed by the application), internal (MHD creates |
@@ -203,7 +204,7 @@ combinations. | |||
203 | @item @b{external} @tab yes @tab no @tab yes | 204 | @item @b{external} @tab yes @tab no @tab yes |
204 | @item @b{internal} @tab yes @tab yes @tab yes | 205 | @item @b{internal} @tab yes @tab yes @tab yes |
205 | @item @b{thread pool} @tab yes @tab yes @tab yes | 206 | @item @b{thread pool} @tab yes @tab yes @tab yes |
206 | @item @b{thread-per-connection} @tab yes @tab yes @tab no | 207 | @item @b{thread-per-connection} @tab yes @tab yes @tab no |
207 | @end multitable | 208 | @end multitable |
208 | @caption{Supported combinations of event styles and thread modes.} | 209 | @caption{Supported combinations of event styles and thread modes.} |
209 | @end float | 210 | @end float |
@@ -239,7 +240,7 @@ full list of options run ``./configure --help''): | |||
239 | @item ``--disable-curl'' | 240 | @item ``--disable-curl'' |
240 | disable running testcases using libcurl | 241 | disable running testcases using libcurl |
241 | 242 | ||
242 | @item ``--disable-largefile'' | 243 | @item ``--disable-largefile'' |
243 | disable support for 64-bit files | 244 | disable support for 64-bit files |
244 | 245 | ||
245 | @item ``--disable-messages'' | 246 | @item ``--disable-messages'' |
@@ -285,7 +286,7 @@ conditional operations. For possible suggestions consult | |||
285 | Once you have ensured that you manually (!) included the right headers | 286 | Once you have ensured that you manually (!) included the right headers |
286 | for your platform before "microhttpd.h", you should also add a line | 287 | for your platform before "microhttpd.h", you should also add a line |
287 | with @code{#define MHD_PLATFORM_H} which will prevent the | 288 | with @code{#define MHD_PLATFORM_H} which will prevent the |
288 | "microhttpd.h" header from trying (and, depending on your platform, | 289 | "microhttpd.h" header from trying (and, depending on your platform, |
289 | failing) to include the right headers. | 290 | failing) to include the right headers. |
290 | 291 | ||
291 | If you do not define MHD_PLATFORM_H, the "microhttpd.h" header will | 292 | If you do not define MHD_PLATFORM_H, the "microhttpd.h" header will |
@@ -297,12 +298,12 @@ causing problems when porting to other platforms). | |||
297 | MHD does not install a signal handler for SIGPIPE. On platforms | 298 | MHD does not install a signal handler for SIGPIPE. On platforms |
298 | where this is possible (such as GNU/Linux), it disables SIGPIPE for | 299 | where this is possible (such as GNU/Linux), it disables SIGPIPE for |
299 | its I/O operations (by passing MSG_NOSIGNAL). On other platforms, | 300 | its I/O operations (by passing MSG_NOSIGNAL). On other platforms, |
300 | SIGPIPE signals may be generated from network operations by | 301 | SIGPIPE signals may be generated from network operations by |
301 | MHD and will cause the process to die unless the developer | 302 | MHD and will cause the process to die unless the developer |
302 | explicitly installs a signal handler for SIGPIPE. | 303 | explicitly installs a signal handler for SIGPIPE. |
303 | 304 | ||
304 | Hence portable code using MHD must install a SIGPIPE handler or | 305 | Hence portable code using MHD must install a SIGPIPE handler or |
305 | explicitly block the SIGPIPE signal. MHD does not do so in order | 306 | explicitly block the SIGPIPE signal. MHD does not do so in order |
306 | to avoid messing with other parts of the application that may | 307 | to avoid messing with other parts of the application that may |
307 | need to handle SIGPIPE in a particular way. You can make your application handle SIGPIPE by calling the following function in @code{main}: | 308 | need to handle SIGPIPE in a particular way. You can make your application handle SIGPIPE by calling the following function in @code{main}: |
308 | 309 | ||
@@ -422,8 +423,8 @@ No options selected. | |||
422 | Run in debug mode. If this flag is used, the library should print error | 423 | Run in debug mode. If this flag is used, the library should print error |
423 | messages and warnings to stderr. Note that for this | 424 | messages and warnings to stderr. Note that for this |
424 | run-time option to have any effect, MHD needs to be | 425 | run-time option to have any effect, MHD needs to be |
425 | compiled with messages enabled. This is done by default except you ran | 426 | compiled with messages enabled. This is done by default except you ran |
426 | configure with the @code{--disable-messages} flag set. | 427 | configure with the @code{--disable-messages} flag set. |
427 | 428 | ||
428 | @item MHD_USE_SSL | 429 | @item MHD_USE_SSL |
429 | @cindex TLS | 430 | @cindex TLS |
@@ -519,7 +520,7 @@ ability to signal termination via the listen socket). In these modes, | |||
519 | @code{MHD_quiesce_daemon} will fail if this option was not set. Also, | 520 | @code{MHD_quiesce_daemon} will fail if this option was not set. Also, |
520 | use of this option is automatic (as in, you do not even have to | 521 | use of this option is automatic (as in, you do not even have to |
521 | specify it), if @code{MHD_USE_NO_LISTEN_SOCKET} is specified. In | 522 | specify it), if @code{MHD_USE_NO_LISTEN_SOCKET} is specified. In |
522 | "external" select mode, this option is always simply ignored. | 523 | "external" select mode, this option is always simply ignored. |
523 | 524 | ||
524 | @end table | 525 | @end table |
525 | @end deftp | 526 | @end deftp |
@@ -533,7 +534,7 @@ MHD options. Passed in the varargs portion of | |||
533 | @item MHD_OPTION_END | 534 | @item MHD_OPTION_END |
534 | No more options / last option. This is used to terminate the VARARGs | 535 | No more options / last option. This is used to terminate the VARARGs |
535 | list. | 536 | list. |
536 | 537 | ||
537 | @item MHD_OPTION_CONNECTION_MEMORY_LIMIT | 538 | @item MHD_OPTION_CONNECTION_MEMORY_LIMIT |
538 | @cindex memory, limiting memory utilization | 539 | @cindex memory, limiting memory utilization |
539 | Maximum memory size per connection (followed by a @code{size_t}). The | 540 | Maximum memory size per connection (followed by a @code{size_t}). The |
@@ -558,19 +559,19 @@ Maximum number of concurrent connections to accept (followed by an | |||
558 | @code{unsigned int}). The default is @code{FD_SETSIZE - 4} (the | 559 | @code{unsigned int}). The default is @code{FD_SETSIZE - 4} (the |
559 | maximum number of file descriptors supported by @code{select} minus | 560 | maximum number of file descriptors supported by @code{select} minus |
560 | four for @code{stdin}, @code{stdout}, @code{stderr} and the server | 561 | four for @code{stdin}, @code{stdout}, @code{stderr} and the server |
561 | socket). In other words, the default is as large as possible. | 562 | socket). In other words, the default is as large as possible. |
562 | 563 | ||
563 | Note that if you set a low connection limit, you can easily get into | 564 | Note that if you set a low connection limit, you can easily get into |
564 | trouble with browsers doing request pipelining. For example, if your | 565 | trouble with browsers doing request pipelining. For example, if your |
565 | connection limit is ``1'', a browser may open a first connection to | 566 | connection limit is ``1'', a browser may open a first connection to |
566 | access your ``index.html'' file, keep it open but use a second | 567 | access your ``index.html'' file, keep it open but use a second |
567 | connection to retrieve CSS files, images and the like. In fact, modern | 568 | connection to retrieve CSS files, images and the like. In fact, modern |
568 | browsers are typically by default configured for up to 15 parallel | 569 | browsers are typically by default configured for up to 15 parallel |
569 | connections to a single server. If this happens, MHD will refuse to | 570 | connections to a single server. If this happens, MHD will refuse to |
570 | even accept the second connection until the first connection is | 571 | even accept the second connection until the first connection is |
571 | closed --- which does not happen until timeout. As a result, the | 572 | closed --- which does not happen until timeout. As a result, the |
572 | browser will fail to render the page and seem to hang. If you expect | 573 | browser will fail to render the page and seem to hang. If you expect |
573 | your server to operate close to the connection limit, you should | 574 | your server to operate close to the connection limit, you should |
574 | first consider using a lower timeout value and also possibly add | 575 | first consider using a lower timeout value and also possibly add |
575 | a ``Connection: close'' header to your response to ensure that | 576 | a ``Connection: close'' header to your response to ensure that |
576 | request pipelining is not used and connections are closed immediately | 577 | request pipelining is not used and connections are closed immediately |
@@ -613,8 +614,8 @@ from the same IP address. | |||
613 | @item MHD_OPTION_SOCK_ADDR | 614 | @item MHD_OPTION_SOCK_ADDR |
614 | @cindex bind, restricting bind | 615 | @cindex bind, restricting bind |
615 | Bind daemon to the supplied socket address. This option should be followed by a | 616 | Bind daemon to the supplied socket address. This option should be followed by a |
616 | @code{struct sockaddr *}. If @code{MHD_USE_IPv6} is specified, | 617 | @code{struct sockaddr *}. If @code{MHD_USE_IPv6} is specified, |
617 | the @code{struct sockaddr*} should point to a @code{struct sockaddr_in6}, | 618 | the @code{struct sockaddr*} should point to a @code{struct sockaddr_in6}, |
618 | otherwise to a @code{struct sockaddr_in}. If this option is not specified, | 619 | otherwise to a @code{struct sockaddr_in}. If this option is not specified, |
619 | the daemon will listen to incoming connections from anywhere. If you use this | 620 | the daemon will listen to incoming connections from anywhere. If you use this |
620 | option, the 'port' argument from @code{MHD_start_daemon} is ignored and the port | 621 | option, the 'port' argument from @code{MHD_start_daemon} is ignored and the port |
@@ -655,7 +656,7 @@ Memory pointer to the private key to be used by the | |||
655 | HTTPS daemon. This option should be followed by an | 656 | HTTPS daemon. This option should be followed by an |
656 | "const char*" argument. | 657 | "const char*" argument. |
657 | This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_CERT'. | 658 | This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_CERT'. |
658 | 659 | ||
659 | @item MHD_OPTION_HTTPS_MEM_CERT | 660 | @item MHD_OPTION_HTTPS_MEM_CERT |
660 | @cindex SSL | 661 | @cindex SSL |
661 | @cindex TLS | 662 | @cindex TLS |
@@ -663,7 +664,7 @@ Memory pointer to the certificate to be used by the | |||
663 | HTTPS daemon. This option should be followed by an | 664 | HTTPS daemon. This option should be followed by an |
664 | "const char*" argument. | 665 | "const char*" argument. |
665 | This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_KEY'. | 666 | This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_KEY'. |
666 | 667 | ||
667 | @item MHD_OPTION_HTTPS_MEM_TRUST | 668 | @item MHD_OPTION_HTTPS_MEM_TRUST |
668 | @cindex SSL | 669 | @cindex SSL |
669 | @cindex TLS | 670 | @cindex TLS |
@@ -677,14 +678,14 @@ of the certificate if needed. | |||
677 | Note that most browsers will only present a client certificate | 678 | Note that most browsers will only present a client certificate |
678 | only if they have one matching the specified CA, not sending | 679 | only if they have one matching the specified CA, not sending |
679 | any certificate otherwise. | 680 | any certificate otherwise. |
680 | 681 | ||
681 | @item MHD_OPTION_HTTPS_CRED_TYPE | 682 | @item MHD_OPTION_HTTPS_CRED_TYPE |
682 | @cindex SSL | 683 | @cindex SSL |
683 | @cindex TLS | 684 | @cindex TLS |
684 | Daemon credentials type. Either certificate or anonymous, | 685 | Daemon credentials type. Either certificate or anonymous, |
685 | this option should be followed by one of the values listed in | 686 | this option should be followed by one of the values listed in |
686 | "enum gnutls_credentials_type_t". | 687 | "enum gnutls_credentials_type_t". |
687 | 688 | ||
688 | @item MHD_OPTION_HTTPS_PRIORITIES | 689 | @item MHD_OPTION_HTTPS_PRIORITIES |
689 | @cindex SSL | 690 | @cindex SSL |
690 | @cindex TLS | 691 | @cindex TLS |
@@ -706,7 +707,7 @@ type "size_t" which specifies the size of the buffer pointed to by the | |||
706 | second argument in bytes. Note that the application must ensure that | 707 | second argument in bytes. Note that the application must ensure that |
707 | the buffer of the second argument remains allocated and unmodified | 708 | the buffer of the second argument remains allocated and unmodified |
708 | while the daemon is running. For security, you SHOULD provide a fresh | 709 | while the daemon is running. For security, you SHOULD provide a fresh |
709 | random nonce when using MHD with Digest Authentication. | 710 | random nonce when using MHD with Digest Authentication. |
710 | 711 | ||
711 | @item MHD_OPTION_NONCE_NC_SIZE | 712 | @item MHD_OPTION_NONCE_NC_SIZE |
712 | @cindex digest auth | 713 | @cindex digest auth |
@@ -737,7 +738,7 @@ Listen socket to use. Pass a listen socket for MHD to use | |||
737 | (systemd-style). If this option is used, MHD will not open its own | 738 | (systemd-style). If this option is used, MHD will not open its own |
738 | listen socket(s). The argument passed must be of type "int" and refer | 739 | listen socket(s). The argument passed must be of type "int" and refer |
739 | to an existing socket that has been bound to a port and is listening. | 740 | to an existing socket that has been bound to a port and is listening. |
740 | 741 | ||
741 | @item MHD_OPTION_EXTERNAL_LOGGER | 742 | @item MHD_OPTION_EXTERNAL_LOGGER |
742 | @cindex logging | 743 | @cindex logging |
743 | Use the given function for logging error messages. | 744 | Use the given function for logging error messages. |
@@ -746,10 +747,10 @@ first must be a pointer to a function | |||
746 | of type 'void fun(void * arg, const char * fmt, va_list ap)' | 747 | of type 'void fun(void * arg, const char * fmt, va_list ap)' |
747 | and the second a pointer of type 'void*' which will | 748 | and the second a pointer of type 'void*' which will |
748 | be passed as the "arg" argument to "fun". | 749 | be passed as the "arg" argument to "fun". |
749 | 750 | ||
750 | Note that MHD will not generate any log messages without | 751 | Note that MHD will not generate any log messages without |
751 | the MHD_USE_DEBUG flag set and if MHD was compiled | 752 | the MHD_USE_DEBUG flag set and if MHD was compiled |
752 | with the "--disable-messages" flag. | 753 | with the "--disable-messages" flag. |
753 | 754 | ||
754 | @item MHD_OPTION_THREAD_POOL_SIZE | 755 | @item MHD_OPTION_THREAD_POOL_SIZE |
755 | @cindex performance | 756 | @cindex performance |
@@ -806,7 +807,7 @@ updated. Note that the unescape function must not lengthen @code{s} | |||
806 | @code{cls} will be set to the second argument following | 807 | @code{cls} will be set to the second argument following |
807 | MHD_OPTION_UNESCAPE_CALLBACK. | 808 | MHD_OPTION_UNESCAPE_CALLBACK. |
808 | 809 | ||
809 | 810 | ||
810 | @item MHD_OPTION_THREAD_STACK_SIZE | 811 | @item MHD_OPTION_THREAD_STACK_SIZE |
811 | @cindex stack | 812 | @cindex stack |
812 | @cindex thread | 813 | @cindex thread |
@@ -814,7 +815,7 @@ MHD_OPTION_UNESCAPE_CALLBACK. | |||
814 | @cindex embedded systems | 815 | @cindex embedded systems |
815 | Maximum stack size for threads created by MHD. This option must be | 816 | Maximum stack size for threads created by MHD. This option must be |
816 | followed by a @code{size_t}). Not specifying this option or using | 817 | followed by a @code{size_t}). Not specifying this option or using |
817 | a value of zero means using the system default (which is likely to | 818 | a value of zero means using the system default (which is likely to |
818 | differ based on your platform). | 819 | differ based on your platform). |
819 | 820 | ||
820 | @end table | 821 | @end table |
@@ -823,7 +824,7 @@ differ based on your platform). | |||
823 | 824 | ||
824 | @deftp {C Struct} MHD_OptionItem | 825 | @deftp {C Struct} MHD_OptionItem |
825 | Entry in an MHD_OPTION_ARRAY. See the @code{MHD_OPTION_ARRAY} option | 826 | Entry in an MHD_OPTION_ARRAY. See the @code{MHD_OPTION_ARRAY} option |
826 | argument for its use. | 827 | argument for its use. |
827 | 828 | ||
828 | The @code{option} member is used to specify which option is specified | 829 | The @code{option} member is used to specify which option is specified |
829 | in the array. The other members specify the respective argument. | 830 | in the array. The other members specify the respective argument. |
@@ -895,7 +896,7 @@ We had to close the session since MHD was being shut down. | |||
895 | 896 | ||
896 | @deftp {Enumeration} MHD_ResponseMemoryMode | 897 | @deftp {Enumeration} MHD_ResponseMemoryMode |
897 | The @code{MHD_ResponeMemoryMode} specifies how MHD should treat | 898 | The @code{MHD_ResponeMemoryMode} specifies how MHD should treat |
898 | the memory buffer given for the response in | 899 | the memory buffer given for the response in |
899 | @code{MHD_create_response_from_buffer}. | 900 | @code{MHD_create_response_from_buffer}. |
900 | 901 | ||
901 | @table @code | 902 | @table @code |
@@ -903,12 +904,12 @@ the memory buffer given for the response in | |||
903 | Buffer is a persistent (static/global) buffer that won't change | 904 | Buffer is a persistent (static/global) buffer that won't change |
904 | for at least the lifetime of the response, MHD should just use | 905 | for at least the lifetime of the response, MHD should just use |
905 | it, not free it, not copy it, just keep an alias to it. | 906 | it, not free it, not copy it, just keep an alias to it. |
906 | 907 | ||
907 | @item MHD_RESPMEM_MUST_FREE | 908 | @item MHD_RESPMEM_MUST_FREE |
908 | Buffer is heap-allocated with @code{malloc} (or equivalent) and | 909 | Buffer is heap-allocated with @code{malloc} (or equivalent) and |
909 | should be freed by MHD after processing the response has | 910 | should be freed by MHD after processing the response has |
910 | concluded (response reference counter reaches zero). | 911 | concluded (response reference counter reaches zero). |
911 | 912 | ||
912 | @item MHD_RESPMEM_MUST_COPY | 913 | @item MHD_RESPMEM_MUST_COPY |
913 | Buffer is in transient memory, but not on the heap (for example, | 914 | Buffer is in transient memory, but not on the heap (for example, |
914 | on the stack or non-malloc allocated) and only valid during the | 915 | on the stack or non-malloc allocated) and only valid during the |
@@ -1094,13 +1095,9 @@ Callback used by MHD in order to obtain content. The callback has to | |||
1094 | copy at most @var{max} bytes of content into @var{buf}. The total | 1095 | copy at most @var{max} bytes of content into @var{buf}. The total |
1095 | number of bytes that has been placed into @var{buf} should be returned. | 1096 | number of bytes that has been placed into @var{buf} should be returned. |
1096 | 1097 | ||
1097 | Note that returning zero will cause MHD to try again, either | 1098 | Note that returning zero will cause MHD to try again. |
1098 | ``immediately'' if in multi-threaded mode (in which case the callback | 1099 | Thus, returning zero should only be used in conjunction |
1099 | may want to do blocking operations to avoid busy waiting) or in the | 1100 | with @code{MHD_suspend_connection()} to avoid busy waiting. |
1100 | next round if @code{MHD_run} is used. Returning zero for a daemon | ||
1101 | that runs in internal @code{select}-mode is an error (since it | ||
1102 | would result in busy waiting) and cause the program to be aborted | ||
1103 | (@code{abort()}). | ||
1104 | 1101 | ||
1105 | While usually the callback simply returns the number of bytes written | 1102 | While usually the callback simply returns the number of bytes written |
1106 | into @var{buf}, there are two special return value: | 1103 | into @var{buf}, there are two special return value: |
@@ -1108,7 +1105,7 @@ into @var{buf}, there are two special return value: | |||
1108 | @code{MHD_CONTENT_READER_END_OF_STREAM} (-1) should be returned | 1105 | @code{MHD_CONTENT_READER_END_OF_STREAM} (-1) should be returned |
1109 | for the regular end of transmission (with chunked encoding, MHD will then | 1106 | for the regular end of transmission (with chunked encoding, MHD will then |
1110 | terminate the chunk and send any HTTP footers that might be | 1107 | terminate the chunk and send any HTTP footers that might be |
1111 | present; without chunked encoding and given an unknown | 1108 | present; without chunked encoding and given an unknown |
1112 | response size, MHD will simply close the connection; note | 1109 | response size, MHD will simply close the connection; note |
1113 | that while returning @code{MHD_CONTENT_READER_END_OF_STREAM} is not technically | 1110 | that while returning @code{MHD_CONTENT_READER_END_OF_STREAM} is not technically |
1114 | legal if a response size was specified, MHD accepts this | 1111 | legal if a response size was specified, MHD accepts this |
@@ -1121,7 +1118,7 @@ given or if chunked encoding is in use, this will indicate | |||
1121 | an error to the client. Note, however, that if the client | 1118 | an error to the client. Note, however, that if the client |
1122 | does not know a response size and chunked encoding is not in | 1119 | does not know a response size and chunked encoding is not in |
1123 | use, then clients will not be able to tell the difference between | 1120 | use, then clients will not be able to tell the difference between |
1124 | @code{MHD_CONTENT_READER_END_WITH_ERROR} and | 1121 | @code{MHD_CONTENT_READER_END_WITH_ERROR} and |
1125 | @code{MHD_CONTENT_READER_END_OF_STREAM}. | 1122 | @code{MHD_CONTENT_READER_END_OF_STREAM}. |
1126 | This is not a limitation of MHD but rather of the HTTP protocol. | 1123 | This is not a limitation of MHD but rather of the HTTP protocol. |
1127 | 1124 | ||
@@ -1198,7 +1195,7 @@ iteration. | |||
1198 | Set a handler for fatal errors. | 1195 | Set a handler for fatal errors. |
1199 | 1196 | ||
1200 | @table @var | 1197 | @table @var |
1201 | @item cb | 1198 | @item cb |
1202 | function to call if MHD encounters a fatal internal error. If no handler was set explicitly, MHD will call @code{abort}. | 1199 | function to call if MHD encounters a fatal internal error. If no handler was set explicitly, MHD will call @code{abort}. |
1203 | 1200 | ||
1204 | @item cls | 1201 | @item cls |
@@ -1252,7 +1249,7 @@ is still using it). | |||
1252 | 1249 | ||
1253 | This function is useful in the special case that a listen socket | 1250 | This function is useful in the special case that a listen socket |
1254 | is to be migrated to another process (i.e. a newer version of the | 1251 | is to be migrated to another process (i.e. a newer version of the |
1255 | HTTP server) while existing connections should continue to be | 1252 | HTTP server) while existing connections should continue to be |
1256 | processed until they are finished. | 1253 | processed until they are finished. |
1257 | 1254 | ||
1258 | Return @code{-1} on error (daemon not listening), the handle to the | 1255 | Return @code{-1} on error (daemon not listening), the handle to the |
@@ -1278,7 +1275,7 @@ However, if using external @code{select} mode, you may want to | |||
1278 | instead use @code{MHD_run_from_select}, as it is more efficient. | 1275 | instead use @code{MHD_run_from_select}, as it is more efficient. |
1279 | 1276 | ||
1280 | @table @var | 1277 | @table @var |
1281 | @item daemon | 1278 | @item daemon |
1282 | daemon to process connections of | 1279 | daemon to process connections of |
1283 | @end table | 1280 | @end table |
1284 | 1281 | ||
@@ -1291,7 +1288,7 @@ started with the right options for this call. | |||
1291 | Run webserver operations given sets of ready socket handles. | 1288 | Run webserver operations given sets of ready socket handles. |
1292 | @cindex select | 1289 | @cindex select |
1293 | 1290 | ||
1294 | This method should be called by clients in combination with | 1291 | This method should be called by clients in combination with |
1295 | @code{MHD_get_fdset} if the client-controlled (external) | 1292 | @code{MHD_get_fdset} if the client-controlled (external) |
1296 | select method is used. | 1293 | select method is used. |
1297 | 1294 | ||
@@ -1303,7 +1300,7 @@ not have to call @code{select} again to determine which operations are | |||
1303 | ready. | 1300 | ready. |
1304 | 1301 | ||
1305 | @table @var | 1302 | @table @var |
1306 | @item daemon | 1303 | @item daemon |
1307 | daemon to process connections of | 1304 | daemon to process connections of |
1308 | @item read_fd_set | 1305 | @item read_fd_set |
1309 | set of descriptors that must be ready for reading without blocking | 1306 | set of descriptors that must be ready for reading without blocking |
@@ -1321,11 +1318,11 @@ errors. | |||
1321 | 1318 | ||
1322 | 1319 | ||
1323 | @deftypefun void MHD_add_connection (struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen) | 1320 | @deftypefun void MHD_add_connection (struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen) |
1324 | Add another client connection to the set of connections | 1321 | Add another client connection to the set of connections |
1325 | managed by MHD. This API is usually not needed (since | 1322 | managed by MHD. This API is usually not needed (since |
1326 | MHD will accept inbound connections on the server socket). | 1323 | MHD will accept inbound connections on the server socket). |
1327 | Use this API in special cases, for example if your HTTP | 1324 | Use this API in special cases, for example if your HTTP |
1328 | server is behind NAT and needs to connect out to the | 1325 | server is behind NAT and needs to connect out to the |
1329 | HTTP client, or if you are building a proxy. | 1326 | HTTP client, or if you are building a proxy. |
1330 | 1327 | ||
1331 | If you use this API in conjunction with a internal select or a thread | 1328 | If you use this API in conjunction with a internal select or a thread |
@@ -1338,17 +1335,17 @@ this call and must no longer be used directly by the application | |||
1338 | afterwards. | 1335 | afterwards. |
1339 | 1336 | ||
1340 | @table @var | 1337 | @table @var |
1341 | @item daemon | 1338 | @item daemon |
1342 | daemon that manages the connection | 1339 | daemon that manages the connection |
1343 | @item client_socket | 1340 | @item client_socket |
1344 | socket to manage (MHD will expect to receive an HTTP request from this socket next). | 1341 | socket to manage (MHD will expect to receive an HTTP request from this socket next). |
1345 | @item addr | 1342 | @item addr |
1346 | IP address of the client | 1343 | IP address of the client |
1347 | @item addrlen | 1344 | @item addrlen |
1348 | number of bytes in addr | 1345 | number of bytes in addr |
1349 | @end table | 1346 | @end table |
1350 | 1347 | ||
1351 | This function will return @code{MHD_YES} on success, | 1348 | This function will return @code{MHD_YES} on success, |
1352 | @code{MHD_NO} if this daemon could | 1349 | @code{MHD_NO} if this daemon could |
1353 | not handle the connection (i.e. malloc failed, etc). | 1350 | not handle the connection (i.e. malloc failed, etc). |
1354 | The socket will be closed in any case; 'errno' is set | 1351 | The socket will be closed in any case; 'errno' is set |
@@ -1387,7 +1384,7 @@ connection timeout is used). The returned value is how long | |||
1387 | @code{select} should at most block, not the timeout value set for | 1384 | @code{select} should at most block, not the timeout value set for |
1388 | connections. This function must not be called if the | 1385 | connections. This function must not be called if the |
1389 | @code{MHD_USE_THREAD_PER_CONNECTION} mode is in use (since then it | 1386 | @code{MHD_USE_THREAD_PER_CONNECTION} mode is in use (since then it |
1390 | is not meaningful to ask for a timeout, after all, there is | 1387 | is not meaningful to ask for a timeout, after all, there is |
1391 | concurrenct activity). The function must also not be called by | 1388 | concurrenct activity). The function must also not be called by |
1392 | user-code if @code{MHD_USE_INTERNAL_SELECT} is in use. In the latter | 1389 | user-code if @code{MHD_USE_INTERNAL_SELECT} is in use. In the latter |
1393 | case, the behavior is undefined. | 1390 | case, the behavior is undefined. |
@@ -1411,7 +1408,7 @@ right now). | |||
1411 | 1408 | ||
1412 | 1409 | ||
1413 | @deftypefun int MHD_get_connection_values (struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls) | 1410 | @deftypefun int MHD_get_connection_values (struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls) |
1414 | Get all the headers matching @var{kind} from the request. | 1411 | Get all the headers matching @var{kind} from the request. |
1415 | 1412 | ||
1416 | The @var{iterator} callback is invoked once for each header, with | 1413 | The @var{iterator} callback is invoked once for each header, with |
1417 | @var{iterator_cls} as first argument. After version 0.9.19, the | 1414 | @var{iterator_cls} as first argument. After version 0.9.19, the |
@@ -1439,9 +1436,9 @@ would contain the string ``key''. | |||
1439 | 1436 | ||
1440 | @deftypefun int MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char * key, const char * value) | 1437 | @deftypefun int MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char * key, const char * value) |
1441 | This function can be used to append an entry to | 1438 | This function can be used to append an entry to |
1442 | the list of HTTP headers of a connection (so that the | 1439 | the list of HTTP headers of a connection (so that the |
1443 | @code{MHD_get_connection_values function} will return | 1440 | @code{MHD_get_connection_values function} will return |
1444 | them -- and the MHD PostProcessor will also | 1441 | them -- and the MHD PostProcessor will also |
1445 | see them). This maybe required in certain | 1442 | see them). This maybe required in certain |
1446 | situations (see Mantis #1399) where (broken) | 1443 | situations (see Mantis #1399) where (broken) |
1447 | HTTP implementations fail to supply values needed | 1444 | HTTP implementations fail to supply values needed |
@@ -1457,11 +1454,11 @@ are NOT freed until the connection is closed. | |||
1457 | (The easiest way to do this is by passing only | 1454 | (The easiest way to do this is by passing only |
1458 | arguments to permanently allocated strings.). | 1455 | arguments to permanently allocated strings.). |
1459 | 1456 | ||
1460 | @var{connection} is the connection for which | 1457 | @var{connection} is the connection for which |
1461 | the entry for @var{key} of the given @var{kind} | 1458 | the entry for @var{key} of the given @var{kind} |
1462 | should be set to the given @var{value}. | 1459 | should be set to the given @var{value}. |
1463 | 1460 | ||
1464 | The function returns @code{MHD_NO} if the operation | 1461 | The function returns @code{MHD_NO} if the operation |
1465 | could not be performed due to insufficient memory | 1462 | could not be performed due to insufficient memory |
1466 | and @code{MHD_YES} on success. | 1463 | and @code{MHD_YES} on success. |
1467 | @end deftypefun | 1464 | @end deftypefun |
@@ -1636,8 +1633,8 @@ size of the file) | |||
1636 | 1633 | ||
1637 | @item fd | 1634 | @item fd |
1638 | file descriptor referring to a file on disk with the data; will be | 1635 | file descriptor referring to a file on disk with the data; will be |
1639 | closed when response is destroyed; note that 'fd' must be an actual | 1636 | closed when response is destroyed; note that 'fd' must be an actual |
1640 | file descriptor (not a pipe or socket) since MHD might use 'sendfile' | 1637 | file descriptor (not a pipe or socket) since MHD might use 'sendfile' |
1641 | or 'seek' on it. The descriptor should be in blocking-IO mode. | 1638 | or 'seek' on it. The descriptor should be in blocking-IO mode. |
1642 | @end table | 1639 | @end table |
1643 | 1640 | ||
@@ -1678,8 +1675,8 @@ file starting at offset). | |||
1678 | 1675 | ||
1679 | @item fd | 1676 | @item fd |
1680 | file descriptor referring to a file on disk with the data; will be | 1677 | file descriptor referring to a file on disk with the data; will be |
1681 | closed when response is destroyed; note that 'fd' must be an actual | 1678 | closed when response is destroyed; note that 'fd' must be an actual |
1682 | file descriptor (not a pipe or socket) since MHD might use 'sendfile' | 1679 | file descriptor (not a pipe or socket) since MHD might use 'sendfile' |
1683 | or 'seek' on it. The descriptor should be in blocking-IO mode. | 1680 | or 'seek' on it. The descriptor should be in blocking-IO mode. |
1684 | 1681 | ||
1685 | @item offset | 1682 | @item offset |
@@ -1701,8 +1698,8 @@ size of the data portion of the response; | |||
1701 | @item buffer | 1698 | @item buffer |
1702 | the data itself; | 1699 | the data itself; |
1703 | 1700 | ||
1704 | @item mode | 1701 | @item mode |
1705 | memory management options for buffer; use | 1702 | memory management options for buffer; use |
1706 | MHD_RESPMEM_PERSISTENT if the buffer is static/global memory, | 1703 | MHD_RESPMEM_PERSISTENT if the buffer is static/global memory, |
1707 | use MHD_RESPMEM_MUST_FREE if the buffer is heap-allocated and | 1704 | use MHD_RESPMEM_MUST_FREE if the buffer is heap-allocated and |
1708 | should be freed by MHD and MHD_RESPMEM_MUST_COPY if the | 1705 | should be freed by MHD and MHD_RESPMEM_MUST_COPY if the |
@@ -1779,7 +1776,7 @@ memory allocation error). | |||
1779 | @deftypefun int MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content) | 1776 | @deftypefun int MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content) |
1780 | Add a footer line to the response. The strings referenced by | 1777 | Add a footer line to the response. The strings referenced by |
1781 | @var{footer} and @var{content} must be zero-terminated and they are | 1778 | @var{footer} and @var{content} must be zero-terminated and they are |
1782 | duplicated into memory blocks embedded in @var{response}. | 1779 | duplicated into memory blocks embedded in @var{response}. |
1783 | 1780 | ||
1784 | Notice that the strings must not hold newlines, carriage returns or tab | 1781 | Notice that the strings must not hold newlines, carriage returns or tab |
1785 | chars. You can add response footers at any time before signalling the | 1782 | chars. You can add response footers at any time before signalling the |
@@ -1833,6 +1830,72 @@ We should not modify the value, unless we know what we are doing. | |||
1833 | @c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1830 | @c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1834 | 1831 | ||
1835 | @c ------------------------------------------------------------ | 1832 | @c ------------------------------------------------------------ |
1833 | @node microhttpd-flow | ||
1834 | @chapter Flow control. | ||
1835 | |||
1836 | @noindent | ||
1837 | Sometimes it may be possible that clients upload data faster | ||
1838 | than an application can process it, or that an application | ||
1839 | needs an extended period of time to generate a response. | ||
1840 | If @code{MHD_USE_THREAD_PER_CONNECTION} is used, applications | ||
1841 | can simply deal with this by performing their logic within the | ||
1842 | thread and thus effectively blocking connection processing | ||
1843 | by MHD. In all other modes, blocking logic must not be | ||
1844 | placed within the callbacks invoked by MHD as this would also | ||
1845 | block processing of other requests, as a single thread may be | ||
1846 | responsible for tens of thousands of connections. | ||
1847 | |||
1848 | Instead, applications using thread modes other than | ||
1849 | @code{MHD_USE_THREAD_PER_CONNECTION} should use the | ||
1850 | following functions to perform flow control. | ||
1851 | |||
1852 | @deftypefun int MHD_suspend_connection (struct MHD_Connection *connection) | ||
1853 | Suspend handling of network data for a given connection. This can | ||
1854 | be used to dequeue a connection from MHD's event loop (external | ||
1855 | select, internal select or thread pool; not applicable to | ||
1856 | thread-per-connection!) for a while. | ||
1857 | |||
1858 | If you use this API in conjunction with a internal select or a | ||
1859 | thread pool, you must set the option @code{MHD_USE_PIPE_FOR_SHUTDOWN} to | ||
1860 | ensure that a resumed connection is immediately processed by MHD. | ||
1861 | |||
1862 | Suspended connections continue to count against the total number of | ||
1863 | connections allowed (per daemon, as well as per IP, if such limits | ||
1864 | are set). Suspended connections will NOT time out; timeouts will | ||
1865 | restart when the connection handling is resumed. While a | ||
1866 | connection is suspended, MHD will not detect disconnects by the | ||
1867 | client. | ||
1868 | |||
1869 | The only safe time to suspend a connection is from the | ||
1870 | @code{MHD_AccessHandlerCallback}. | ||
1871 | |||
1872 | Finally, it is an API violation to call @code{MHD_stop_daemon} while | ||
1873 | having suspended connections (this will at least create memory and | ||
1874 | socket leaks or lead to undefined behavior). You must explicitly | ||
1875 | resume all connections before stopping the daemon. | ||
1876 | |||
1877 | @table @var | ||
1878 | @item connection | ||
1879 | the connection to suspend | ||
1880 | @end table | ||
1881 | @end deftypefun | ||
1882 | |||
1883 | @deftypefun int MHD_resume_connection (struct MHD_Connection *connection) | ||
1884 | Resume handling of network data for suspended connection. It is safe | ||
1885 | to resume a suspended connection at any time. Calling this function | ||
1886 | on a connection that was not previously suspended will result in | ||
1887 | undefined behavior. | ||
1888 | |||
1889 | @table @var | ||
1890 | @item connection | ||
1891 | the connection to resume | ||
1892 | @end table | ||
1893 | @end deftypefun | ||
1894 | |||
1895 | |||
1896 | @c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
1897 | |||
1898 | @c ------------------------------------------------------------ | ||
1836 | @node microhttpd-dauth | 1899 | @node microhttpd-dauth |
1837 | @chapter Utilizing Authentication | 1900 | @chapter Utilizing Authentication |
1838 | 1901 | ||
@@ -1960,41 +2023,41 @@ ahc_echo (void *cls, | |||
1960 | int ret; | 2023 | int ret; |
1961 | 2024 | ||
1962 | username = MHD_digest_auth_get_username(connection); | 2025 | username = MHD_digest_auth_get_username(connection); |
1963 | if (username == NULL) | 2026 | if (username == NULL) |
1964 | @{ | 2027 | @{ |
1965 | response = MHD_create_response_from_buffer(strlen (DENIED), | 2028 | response = MHD_create_response_from_buffer(strlen (DENIED), |
1966 | DENIED, | 2029 | DENIED, |
1967 | MHD_RESPMEM_PERSISTENT); | 2030 | MHD_RESPMEM_PERSISTENT); |
1968 | ret = MHD_queue_auth_fail_response(connection, realm, | 2031 | ret = MHD_queue_auth_fail_response(connection, realm, |
1969 | OPAQUE, | 2032 | OPAQUE, |
1970 | response, | 2033 | response, |
1971 | MHD_NO); | 2034 | MHD_NO); |
1972 | MHD_destroy_response(response); | 2035 | MHD_destroy_response(response); |
1973 | return ret; | 2036 | return ret; |
1974 | @} | 2037 | @} |
1975 | ret = MHD_digest_auth_check(connection, realm, | 2038 | ret = MHD_digest_auth_check(connection, realm, |
1976 | username, | 2039 | username, |
1977 | password, | 2040 | password, |
1978 | 300); | 2041 | 300); |
1979 | free(username); | 2042 | free(username); |
1980 | if ( (ret == MHD_INVALID_NONCE) || | 2043 | if ( (ret == MHD_INVALID_NONCE) || |
1981 | (ret == MHD_NO) ) | 2044 | (ret == MHD_NO) ) |
1982 | @{ | 2045 | @{ |
1983 | response = MHD_create_response_from_buffer(strlen (DENIED), | 2046 | response = MHD_create_response_from_buffer(strlen (DENIED), |
1984 | DENIED, | 2047 | DENIED, |
1985 | MHD_RESPMEM_PERSISTENT); | 2048 | MHD_RESPMEM_PERSISTENT); |
1986 | if (NULL == response) | 2049 | if (NULL == response) |
1987 | return MHD_NO; | 2050 | return MHD_NO; |
1988 | ret = MHD_queue_auth_fail_response(connection, realm, | 2051 | ret = MHD_queue_auth_fail_response(connection, realm, |
1989 | OPAQUE, | 2052 | OPAQUE, |
1990 | response, | 2053 | response, |
1991 | (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); | 2054 | (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); |
1992 | MHD_destroy_response(response); | 2055 | MHD_destroy_response(response); |
1993 | return ret; | 2056 | return ret; |
1994 | @} | 2057 | @} |
1995 | response = MHD_create_response_from_buffer (strlen(PAGE), PAGE, | 2058 | response = MHD_create_response_from_buffer (strlen(PAGE), PAGE, |
1996 | MHD_RESPMEM_PERSISTENT); | 2059 | MHD_RESPMEM_PERSISTENT); |
1997 | ret = MHD_queue_response(connection, MHD_HTTP_OK, response); | 2060 | ret = MHD_queue_response(connection, MHD_HTTP_OK, response); |
1998 | MHD_destroy_response(response); | 2061 | MHD_destroy_response(response); |
1999 | return ret; | 2062 | return ret; |
2000 | @} | 2063 | @} |
@@ -2026,7 +2089,7 @@ its @code{*@var{con_cls}} argument is set to @code{NULL}. When @code{POST} | |||
2026 | data comes in the upload buffer it is @strong{mandatory} to use the | 2089 | data comes in the upload buffer it is @strong{mandatory} to use the |
2027 | @var{con_cls} to store a reference to per-connection data. The fact | 2090 | @var{con_cls} to store a reference to per-connection data. The fact |
2028 | that the pointer was initially @code{NULL} can be used to detect that | 2091 | that the pointer was initially @code{NULL} can be used to detect that |
2029 | this is a new request. | 2092 | this is a new request. |
2030 | 2093 | ||
2031 | One method to detect that a new connection was established is | 2094 | One method to detect that a new connection was established is |
2032 | to set @code{*con_cls} to an unused integer: | 2095 | to set @code{*con_cls} to an unused integer: |
@@ -2043,7 +2106,7 @@ access_handler (void *cls, | |||
2043 | static int old_connection_marker; | 2106 | static int old_connection_marker; |
2044 | int new_connection = (NULL == *con_cls); | 2107 | int new_connection = (NULL == *con_cls); |
2045 | 2108 | ||
2046 | if (new_connection) | 2109 | if (new_connection) |
2047 | @{ | 2110 | @{ |
2048 | /* new connection with POST */ | 2111 | /* new connection with POST */ |
2049 | *con_cls = &old_connection_marker; | 2112 | *con_cls = &old_connection_marker; |
@@ -2070,13 +2133,13 @@ access_handler (void *cls, | |||
2070 | @{ | 2133 | @{ |
2071 | struct MHD_PostProcessor * pp = *con_cls; | 2134 | struct MHD_PostProcessor * pp = *con_cls; |
2072 | 2135 | ||
2073 | if (pp == NULL) | 2136 | if (pp == NULL) |
2074 | @{ | 2137 | @{ |
2075 | pp = MHD_create_post_processor(connection, ...); | 2138 | pp = MHD_create_post_processor(connection, ...); |
2076 | *con_cls = pp; | 2139 | *con_cls = pp; |
2077 | return MHD_YES; | 2140 | return MHD_YES; |
2078 | @} | 2141 | @} |
2079 | if (*upload_data_size) | 2142 | if (*upload_data_size) |
2080 | @{ | 2143 | @{ |
2081 | MHD_post_process(pp, upload_data, *upload_data_size); | 2144 | MHD_post_process(pp, upload_data, *upload_data_size); |
2082 | *upload_data_size = 0; | 2145 | *upload_data_size = 0; |
@@ -2161,7 +2224,7 @@ is no special call to the iterator to indicate the end of the post processing | |||
2161 | stream. After destroying the PostProcessor, the programmer should | 2224 | stream. After destroying the PostProcessor, the programmer should |
2162 | perform any necessary work to complete the processing of the iterator. | 2225 | perform any necessary work to complete the processing of the iterator. |
2163 | 2226 | ||
2164 | Return @code{MHD_YES} if processing completed nicely, @code{MHD_NO} | 2227 | Return @code{MHD_YES} if processing completed nicely, @code{MHD_NO} |
2165 | if there were spurious characters or formatting problems with | 2228 | if there were spurious characters or formatting problems with |
2166 | the post request. It is common to ignore the return value | 2229 | the post request. It is common to ignore the return value |
2167 | of this function. | 2230 | of this function. |
@@ -2285,7 +2348,7 @@ connection is desired. | |||
2285 | @table @code | 2348 | @table @code |
2286 | 2349 | ||
2287 | @item MHD_CONNECTION_INFO_CIPHER_ALGO | 2350 | @item MHD_CONNECTION_INFO_CIPHER_ALGO |
2288 | What cipher algorithm is being used (HTTPS connections only). | 2351 | What cipher algorithm is being used (HTTPS connections only). |
2289 | Takes no extra arguments. | 2352 | Takes no extra arguments. |
2290 | @code{NULL} is returned for non-HTTPS connections. | 2353 | @code{NULL} is returned for non-HTTPS connections. |
2291 | 2354 | ||
@@ -2295,7 +2358,7 @@ Takes no extra arguments. Allows finding out the TLS/SSL protocol used | |||
2295 | @code{NULL} is returned for non-HTTPS connections. | 2358 | @code{NULL} is returned for non-HTTPS connections. |
2296 | 2359 | ||
2297 | @item MHD_CONNECTION_INFO_CLIENT_ADDRESS | 2360 | @item MHD_CONNECTION_INFO_CLIENT_ADDRESS |
2298 | Returns information about the address of the client. Returns | 2361 | Returns information about the address of the client. Returns |
2299 | essentially a @code{struct sockaddr **} (since the API returns | 2362 | essentially a @code{struct sockaddr **} (since the API returns |
2300 | a @code{union MHD_ConnectionInfo *} and that union contains | 2363 | a @code{union MHD_ConnectionInfo *} and that union contains |
2301 | a @code{struct sockaddr *}). | 2364 | a @code{struct sockaddr *}). |
@@ -2303,7 +2366,7 @@ a @code{struct sockaddr *}). | |||
2303 | @item MHD_CONNECTION_INFO_GNUTLS_SESSION, | 2366 | @item MHD_CONNECTION_INFO_GNUTLS_SESSION, |
2304 | Takes no extra arguments. Allows access to the underlying GNUtls session, | 2367 | Takes no extra arguments. Allows access to the underlying GNUtls session, |
2305 | including access to the underlying GNUtls client certificate | 2368 | including access to the underlying GNUtls client certificate |
2306 | (HTTPS connections only). Takes no extra arguments. | 2369 | (HTTPS connections only). Takes no extra arguments. |
2307 | @code{NULL} is returned for non-HTTPS connections. | 2370 | @code{NULL} is returned for non-HTTPS connections. |
2308 | 2371 | ||
2309 | @item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, | 2372 | @item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, |
@@ -2367,7 +2430,7 @@ connection should be changed. | |||
2367 | @item MHD_CONNECTION_OPTION_TIMEOUT | 2430 | @item MHD_CONNECTION_OPTION_TIMEOUT |
2368 | Set a custom timeout for the given connection. Specified | 2431 | Set a custom timeout for the given connection. Specified |
2369 | as the number of seconds, given as an @code{unsigned int}. Use | 2432 | as the number of seconds, given as an @code{unsigned int}. Use |
2370 | zero for no timeout. | 2433 | zero for no timeout. |
2371 | 2434 | ||
2372 | @end table | 2435 | @end table |
2373 | @end deftp | 2436 | @end deftp |