diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-08 22:59:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-08 22:59:05 +0200 |
commit | 6347f514aa2388e774d5bf356df8046864e5f73c (patch) | |
tree | 98cebf52cce627341d62620255f0ffe0ed36365d /doc | |
parent | 6702e6202368720d7a381669c03eedc318f225ca (diff) | |
download | libmicrohttpd-6347f514aa2388e774d5bf356df8046864e5f73c.tar.gz libmicrohttpd-6347f514aa2388e774d5bf356df8046864e5f73c.zip |
introduce 'enum MHD_Result'
Diffstat (limited to 'doc')
-rw-r--r-- | doc/libmicrohttpd.texi | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi index 4814b3c6..e89f75ed 100644 --- a/doc/libmicrohttpd.texi +++ b/doc/libmicrohttpd.texi | |||
@@ -1284,7 +1284,7 @@ Information about an MHD daemon. | |||
1284 | @chapter Callback functions definition | 1284 | @chapter Callback functions definition |
1285 | 1285 | ||
1286 | 1286 | ||
1287 | @deftypefn {Function Pointer} int {*MHD_AcceptPolicyCallback} (void *cls, const struct sockaddr * addr, socklen_t addrlen) | 1287 | @deftypefn {Function Pointer} enum MHD_Result {*MHD_AcceptPolicyCallback} (void *cls, const struct sockaddr * addr, socklen_t addrlen) |
1288 | Invoked in the context of a connection to allow or deny a client to | 1288 | Invoked in the context of a connection to allow or deny a client to |
1289 | connect. This callback return @code{MHD_YES} if connection is allowed, | 1289 | connect. This callback return @code{MHD_YES} if connection is allowed, |
1290 | @code{MHD_NO} if not. | 1290 | @code{MHD_NO} if not. |
@@ -1300,7 +1300,7 @@ length of the address information. | |||
1300 | @end deftypefn | 1300 | @end deftypefn |
1301 | 1301 | ||
1302 | 1302 | ||
1303 | @deftypefn {Function Pointer} int {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) | 1303 | @deftypefn {Function Pointer} enum MHD_Result {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) |
1304 | Invoked in the context of a connection to answer a request from the | 1304 | Invoked in the context of a connection to answer a request from the |
1305 | client. This callback must call MHD functions (example: the | 1305 | client. This callback must call MHD functions (example: the |
1306 | @code{MHD_Response} ones) to provide content to give back to the client | 1306 | @code{MHD_Response} ones) to provide content to give back to the client |
@@ -1403,7 +1403,7 @@ reason for request termination see @code{MHD_OPTION_NOTIFY_COMPLETED}. | |||
1403 | @end deftypefn | 1403 | @end deftypefn |
1404 | 1404 | ||
1405 | 1405 | ||
1406 | @deftypefn {Function Pointer} int {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value, size_t value_size) | 1406 | @deftypefn {Function Pointer} enum MHD_Result {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value, size_t value_size) |
1407 | Iterator over key-value pairs. This iterator can be used to iterate | 1407 | Iterator over key-value pairs. This iterator can be used to iterate |
1408 | over all of the cookies, headers, or @code{POST}-data fields of a | 1408 | over all of the cookies, headers, or @code{POST}-data fields of a |
1409 | request, and also to iterate over the headers that have been added to a | 1409 | request, and also to iterate over the headers that have been added to a |
@@ -1440,7 +1440,7 @@ iteration. | |||
1440 | @end deftypefn | 1440 | @end deftypefn |
1441 | 1441 | ||
1442 | 1442 | ||
1443 | @deftypefn {Function Pointer} int {*MHD_ContentReaderCallback} (void *cls, uint64_t pos, char *buf, size_t max) | 1443 | @deftypefn {Function Pointer} ssize_t {*MHD_ContentReaderCallback} (void *cls, uint64_t pos, char *buf, size_t max) |
1444 | Callback used by MHD in order to obtain content. The callback has to | 1444 | Callback used by MHD in order to obtain content. The callback has to |
1445 | copy at most @var{max} bytes of content into @var{buf}. The total | 1445 | copy at most @var{max} bytes of content into @var{buf}. The total |
1446 | number of bytes that has been placed into @var{buf} should be returned. | 1446 | number of bytes that has been placed into @var{buf} should be returned. |
@@ -1496,7 +1496,7 @@ It should be used to free resources associated with the content reader. | |||
1496 | @end deftypefn | 1496 | @end deftypefn |
1497 | 1497 | ||
1498 | 1498 | ||
1499 | @deftypefn {Function Pointer} int {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) | 1499 | @deftypefn {Function Pointer} enum MHD_Result {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) |
1500 | Iterator over key-value pairs where the value maybe made available in | 1500 | Iterator over key-value pairs where the value maybe made available in |
1501 | increments and/or may not be zero-terminated. Used for processing | 1501 | increments and/or may not be zero-terminated. Used for processing |
1502 | @code{POST} data. | 1502 | @code{POST} data. |
@@ -1587,7 +1587,7 @@ Return @code{NULL} on error, handle to daemon on success. | |||
1587 | @end deftypefun | 1587 | @end deftypefun |
1588 | 1588 | ||
1589 | 1589 | ||
1590 | @deftypefun int MHD_quiesce_daemon (struct MHD_Daemon *daemon) | 1590 | @deftypefun MHD_socket MHD_quiesce_daemon (struct MHD_Daemon *daemon) |
1591 | @cindex quiesce | 1591 | @cindex quiesce |
1592 | Stop accepting connections from the listening socket. Allows clients | 1592 | Stop accepting connections from the listening socket. Allows clients |
1593 | to continue processing, but stops accepting new connections. Note | 1593 | to continue processing, but stops accepting new connections. Note |
@@ -1613,7 +1613,7 @@ Shutdown an HTTP daemon. | |||
1613 | @end deftypefun | 1613 | @end deftypefun |
1614 | 1614 | ||
1615 | 1615 | ||
1616 | @deftypefun int MHD_run (struct MHD_Daemon *daemon) | 1616 | @deftypefun enum MHD_Result MHD_run (struct MHD_Daemon *daemon) |
1617 | Run webserver operations (without blocking unless in client callbacks). | 1617 | Run webserver operations (without blocking unless in client callbacks). |
1618 | This method should be called by clients in combination with | 1618 | This method should be called by clients in combination with |
1619 | @code{MHD_get_fdset()} if the client-controlled @code{select}-method is used. | 1619 | @code{MHD_get_fdset()} if the client-controlled @code{select}-method is used. |
@@ -1634,7 +1634,7 @@ started with the right options for this call. | |||
1634 | @end deftypefun | 1634 | @end deftypefun |
1635 | 1635 | ||
1636 | 1636 | ||
1637 | @deftypefun int MHD_run_from_select (struct MHD_Daemon *daemon, const fd_set *read_fd_set, const fd_set *write_fd_set, const fd_set *except_fd_set) | 1637 | @deftypefun enum MHD_Result MHD_run_from_select (struct MHD_Daemon *daemon, const fd_set *read_fd_set, const fd_set *write_fd_set, const fd_set *except_fd_set) |
1638 | Run webserver operations given sets of ready socket handles. | 1638 | Run webserver operations given sets of ready socket handles. |
1639 | @cindex select | 1639 | @cindex select |
1640 | 1640 | ||
@@ -1710,7 +1710,7 @@ to indicate further details about the error. | |||
1710 | @chapter Implementing external @code{select} | 1710 | @chapter Implementing external @code{select} |
1711 | 1711 | ||
1712 | 1712 | ||
1713 | @deftypefun int MHD_get_fdset (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd) | 1713 | @deftypefun enum MHD_Result MHD_get_fdset (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd) |
1714 | Obtain the @code{select()} sets for this daemon. The daemon's socket | 1714 | Obtain the @code{select()} sets for this daemon. The daemon's socket |
1715 | is added to @var{read_fd_set}. The list of currently existent | 1715 | is added to @var{read_fd_set}. The list of currently existent |
1716 | connections is scanned and their file descriptors added to the correct | 1716 | connections is scanned and their file descriptors added to the correct |
@@ -1736,12 +1736,12 @@ the right options for this call. | |||
1736 | @end deftypefun | 1736 | @end deftypefun |
1737 | 1737 | ||
1738 | 1738 | ||
1739 | @deftypefun int MHD_get_fdset2 (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd, unsigned int fd_setsize) | 1739 | @deftypefun enum MHD_Result MHD_get_fdset2 (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd, unsigned int fd_setsize) |
1740 | Like @code{MHD_get_fdset()}, except that you can manually specify the value of FD_SETSIZE used by your application. | 1740 | Like @code{MHD_get_fdset()}, except that you can manually specify the value of FD_SETSIZE used by your application. |
1741 | @end deftypefun | 1741 | @end deftypefun |
1742 | 1742 | ||
1743 | 1743 | ||
1744 | @deftypefun int MHD_get_timeout (struct MHD_Daemon *daemon, unsigned long long *timeout) | 1744 | @deftypefun enum MHD_Result MHD_get_timeout (struct MHD_Daemon *daemon, unsigned long long *timeout) |
1745 | @cindex timeout | 1745 | @cindex timeout |
1746 | Obtain timeout value for select for this daemon (only needed if | 1746 | Obtain timeout value for select for this daemon (only needed if |
1747 | connection timeout is used). The returned value is how many | 1747 | connection timeout is used). The returned value is how many |
@@ -1802,7 +1802,7 @@ would contain the string ``key''. | |||
1802 | @end deftypefun | 1802 | @end deftypefun |
1803 | 1803 | ||
1804 | 1804 | ||
1805 | @deftypefun int MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value) | 1805 | @deftypefun enum MHD_Result MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value) |
1806 | This function can be used to append an entry to | 1806 | This function can be used to append an entry to |
1807 | the list of HTTP headers of a connection (so that the | 1807 | the list of HTTP headers of a connection (so that the |
1808 | @code{MHD_get_connection_values function} will return | 1808 | @code{MHD_get_connection_values function} will return |
@@ -1884,7 +1884,7 @@ response and we finally destroy it only when the daemon shuts down. | |||
1884 | @section Enqueuing a response | 1884 | @section Enqueuing a response |
1885 | 1885 | ||
1886 | 1886 | ||
1887 | @deftypefun int MHD_queue_response (struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response) | 1887 | @deftypefun enum MHD_Result MHD_queue_response (struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response) |
1888 | Queue a response to be transmitted to the client as soon as possible | 1888 | Queue a response to be transmitted to the client as soon as possible |
1889 | but only after MHD_AccessHandlerCallback returns. This function | 1889 | but only after MHD_AccessHandlerCallback returns. This function |
1890 | checks that it is legal to queue a response at this time for the | 1890 | checks that it is legal to queue a response at this time for the |
@@ -2148,7 +2148,7 @@ MHD_destroy_response(response); | |||
2148 | @section Adding headers to a response | 2148 | @section Adding headers to a response |
2149 | 2149 | ||
2150 | 2150 | ||
2151 | @deftypefun int MHD_add_response_header (struct MHD_Response *response, const char *header, const char *content) | 2151 | @deftypefun enum MHD_Result MHD_add_response_header (struct MHD_Response *response, const char *header, const char *content) |
2152 | Add a header line to the response. The strings referenced by | 2152 | Add a header line to the response. The strings referenced by |
2153 | @var{header} and @var{content} must be zero-terminated and they are | 2153 | @var{header} and @var{content} must be zero-terminated and they are |
2154 | duplicated into memory blocks embedded in @var{response}. | 2154 | duplicated into memory blocks embedded in @var{response}. |
@@ -2172,7 +2172,7 @@ memory allocation error). | |||
2172 | @end deftypefun | 2172 | @end deftypefun |
2173 | 2173 | ||
2174 | 2174 | ||
2175 | @deftypefun int MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content) | 2175 | @deftypefun enum MHD_Result MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content) |
2176 | Add a footer line to the response. The strings referenced by | 2176 | Add a footer line to the response. The strings referenced by |
2177 | @var{footer} and @var{content} must be zero-terminated and they are | 2177 | @var{footer} and @var{content} must be zero-terminated and they are |
2178 | duplicated into memory blocks embedded in @var{response}. | 2178 | duplicated into memory blocks embedded in @var{response}. |
@@ -2190,7 +2190,7 @@ memory allocation error). | |||
2190 | 2190 | ||
2191 | 2191 | ||
2192 | 2192 | ||
2193 | @deftypefun int MHD_del_response_header (struct MHD_Response *response, const char *header, const char *content) | 2193 | @deftypefun enum MHD_Result MHD_del_response_header (struct MHD_Response *response, const char *header, const char *content) |
2194 | Delete a header (or footer) line from the response. Return @code{MHD_NO} on error | 2194 | Delete a header (or footer) line from the response. Return @code{MHD_NO} on error |
2195 | (arguments are invalid or no such header known). | 2195 | (arguments are invalid or no such header known). |
2196 | @end deftypefun | 2196 | @end deftypefun |
@@ -2201,7 +2201,7 @@ Delete a header (or footer) line from the response. Return @code{MHD_NO} on err | |||
2201 | @section Setting response options | 2201 | @section Setting response options |
2202 | 2202 | ||
2203 | 2203 | ||
2204 | @deftypefun int MHD_set_response_options (struct MHD_Response *response, enum MHD_ResponseFlags flags, ...) | 2204 | @deftypefun enum MHD_Result MHD_set_response_options (struct MHD_Response *response, enum MHD_ResponseFlags flags, ...) |
2205 | Set special flags and options for a response. | 2205 | Set special flags and options for a response. |
2206 | 2206 | ||
2207 | Calling this functions sets the given flags and options for the response. | 2207 | Calling this functions sets the given flags and options for the response. |
@@ -2281,7 +2281,7 @@ a connection by queueing a response (using the | |||
2281 | have been created with the following function: | 2281 | have been created with the following function: |
2282 | 2282 | ||
2283 | 2283 | ||
2284 | @deftypefun int MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls) | 2284 | @deftypefun enum MHD_Result MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls) |
2285 | Create a response suitable for switching protocols. Returns @code{MHD_YES} on success. @code{upgrade_handler} must not be @code{NULL}. | 2285 | Create a response suitable for switching protocols. Returns @code{MHD_YES} on success. @code{upgrade_handler} must not be @code{NULL}. |
2286 | 2286 | ||
2287 | When creating this type of response, the ``Connection: Upgrade'' | 2287 | When creating this type of response, the ``Connection: Upgrade'' |
@@ -2322,7 +2322,7 @@ argument for calls to @code{MHD_upgrade_action}. Applications must eventually u | |||
2322 | 2322 | ||
2323 | @end deftypefn | 2323 | @end deftypefn |
2324 | 2324 | ||
2325 | @deftypefun int MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action, ...) | 2325 | @deftypefun enum MHD_Result MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action, ...) |
2326 | Perform special operations related to upgraded connections. | 2326 | Perform special operations related to upgraded connections. |
2327 | 2327 | ||
2328 | @table @var | 2328 | @table @var |
@@ -2374,7 +2374,7 @@ Instead, applications using thread modes other than | |||
2374 | @code{MHD_USE_THREAD_PER_CONNECTION} should use the | 2374 | @code{MHD_USE_THREAD_PER_CONNECTION} should use the |
2375 | following functions to perform flow control. | 2375 | following functions to perform flow control. |
2376 | 2376 | ||
2377 | @deftypefun int MHD_suspend_connection (struct MHD_Connection *connection) | 2377 | @deftypefun enum MHD_Result MHD_suspend_connection (struct MHD_Connection *connection) |
2378 | Suspend handling of network data for a given connection. This can | 2378 | Suspend handling of network data for a given connection. This can |
2379 | be used to dequeue a connection from MHD's event loop (external | 2379 | be used to dequeue a connection from MHD's event loop (external |
2380 | select, internal select or thread pool; not applicable to | 2380 | select, internal select or thread pool; not applicable to |
@@ -2408,7 +2408,7 @@ the connection to suspend | |||
2408 | @end table | 2408 | @end table |
2409 | @end deftypefun | 2409 | @end deftypefun |
2410 | 2410 | ||
2411 | @deftypefun int MHD_resume_connection (struct MHD_Connection *connection) | 2411 | @deftypefun enum MHD_Result MHD_resume_connection (struct MHD_Connection *connection) |
2412 | Resume handling of network data for suspended connection. It is safe | 2412 | Resume handling of network data for suspended connection. It is safe |
2413 | to resume a suspended connection at any time. Calling this function | 2413 | to resume a suspended connection at any time. Calling this function |
2414 | on a connection that was not previously suspended will result in | 2414 | on a connection that was not previously suspended will result in |
@@ -2602,7 +2602,7 @@ Most of the time it is sound to specify 300 seconds as its values. | |||
2602 | @end deftypefun | 2602 | @end deftypefun |
2603 | 2603 | ||
2604 | 2604 | ||
2605 | @deftypefun int MHD_queue_auth_fail_response2 (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale, enum MHD_DigestAuthAlgorithm algo) | 2605 | @deftypefun enum MHD_Result MHD_queue_auth_fail_response2 (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale, enum MHD_DigestAuthAlgorithm algo) |
2606 | Queues a response to request authentication from the client, | 2606 | Queues a response to request authentication from the client, |
2607 | return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. | 2607 | return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. |
2608 | 2608 | ||
@@ -2626,7 +2626,7 @@ must then be selected when checking digests received from clients! | |||
2626 | @end deftypefun | 2626 | @end deftypefun |
2627 | 2627 | ||
2628 | 2628 | ||
2629 | @deftypefun int MHD_queue_auth_fail_response (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale) | 2629 | @deftypefun enum MHD_Result MHD_queue_auth_fail_response (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale) |
2630 | Queues a response to request authentication from the client, | 2630 | Queues a response to request authentication from the client, |
2631 | return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. | 2631 | return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. |
2632 | 2632 | ||
@@ -2847,7 +2847,7 @@ a PP handle. | |||
2847 | @end deftypefun | 2847 | @end deftypefun |
2848 | 2848 | ||
2849 | 2849 | ||
2850 | @deftypefun int MHD_post_process (struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len) | 2850 | @deftypefun enum MHD_Result MHD_post_process (struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len) |
2851 | Parse and process @code{POST} data. Call this function when @code{POST} | 2851 | Parse and process @code{POST} data. Call this function when @code{POST} |
2852 | data is available (usually during an @code{MHD_AccessHandlerCallback}) | 2852 | data is available (usually during an @code{MHD_AccessHandlerCallback}) |
2853 | with the @var{upload_data} and @var{upload_data_size}. Whenever | 2853 | with the @var{upload_data} and @var{upload_data_size}. Whenever |
@@ -2870,7 +2870,7 @@ Return @code{MHD_YES} on success, @code{MHD_NO} on error | |||
2870 | @end deftypefun | 2870 | @end deftypefun |
2871 | 2871 | ||
2872 | 2872 | ||
2873 | @deftypefun int MHD_destroy_post_processor (struct MHD_PostProcessor *pp) | 2873 | @deftypefun enum MHD_Result MHD_destroy_post_processor (struct MHD_PostProcessor *pp) |
2874 | Release PostProcessor resources. After this function is being called, | 2874 | Release PostProcessor resources. After this function is being called, |
2875 | the PostProcessor is guaranteed to no longer call its iterator. There | 2875 | the PostProcessor is guaranteed to no longer call its iterator. There |
2876 | is no special call to the iterator to indicate the end of the post processing | 2876 | is no special call to the iterator to indicate the end of the post processing |