Improve HTTPD documentation

This commit is contained in:
Dirk Ziegelmeier 2017-11-17 10:08:35 +01:00
parent b0344518e8
commit 1e0501c31a
4 changed files with 29 additions and 11 deletions

View File

@ -2090,6 +2090,12 @@ PREDEFINED = __DOXYGEN__=1 \
SNMP_USE_RAW=1 \
MIB2_STATS=1 \
LWIP_MDNS_RESPONDER=1 \
HTTPD_ENABLE_HTTPS=1 \
LWIP_HTTPD_CGI=1 \
LWIP_HTTPD_SSI=1 \
LWIP_HTTPD_SSI_RAW=1 \
LWIP_HTTPD_SUPPORT_POST=1 \
LWIP_HTTPD_POST_MANUAL_WND=1 \
MEMP_OVERFLOW_CHECK=0 \
MEMP_SANITY_CHECK=1 \
LWIP_ARP=1 \
@ -2119,8 +2125,7 @@ PREDEFINED = __DOXYGEN__=1 \
SO_REUSE=1 \
SO_REUSE_RXTOALL=1 \
LWIP_HAVE_SLIPIF=1 \
LWIP_6LOWPAN=1 \
HTTPD_ENABLE_HTTPS=1
LWIP_6LOWPAN=1
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The

View File

@ -1844,7 +1844,9 @@ http_post_request(struct pbuf *inp, struct http_state *hs,
}
#if LWIP_HTTPD_POST_MANUAL_WND
/** A POST implementation can call this function to update the TCP window.
/**
* @ingroup httpd
* A POST implementation can call this function to update the TCP window.
* This can be used to throttle data reception (e.g. when received data is
* programmed to flash and data is received faster than programmed).
*
@ -2653,6 +2655,7 @@ httpd_inits(struct altcp_tls_config *conf)
#if LWIP_HTTPD_SSI
/**
* @ingroup httpd
* Set the SSI handler function.
*
* @param ssi_handler the SSI handler function
@ -2682,6 +2685,7 @@ http_set_ssi_handler(tSSIHandler ssi_handler, const char **tags, int num_tags)
#if LWIP_HTTPD_CGI
/**
* @ingroup httpd
* Set an array of CGI filenames/handler functions
*
* @param cgis an array of CGI filenames/handler functions

View File

@ -51,7 +51,8 @@ extern "C" {
#if LWIP_HTTPD_CGI
/*
/**
* @ingroup httpd
* Function pointer for a CGI script handler.
*
* This function is called each time the HTTPD server is asked for a file
@ -83,7 +84,8 @@ extern "C" {
typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
char *pcValue[]);
/*
/**
* @ingroup httpd
* Structure defining the base filename (URL) of a CGI and the associated
* function which is to be called when that URL is requested.
*/
@ -117,7 +119,8 @@ extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, c
#if LWIP_HTTPD_SSI
/*
/**
* @ingroup httpd
* Function pointer for the SSI tag handler callback.
*
* This function will be called each time the HTTPD server detects a tag of the
@ -144,7 +147,7 @@ extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, c
* within JavaScript and, hence, leaving the tag in place will result in
* problems in these cases. To work around this, any SSI tag which needs to
* output JavaScript code must do so in an encapsulated way, sending the whole
* HTML <script>...</script> section as a single include.
* HTML &lt;script&gt;...&lt;/script&gt; section as a single include.
*/
typedef u16_t (*tSSIHandler)(
#if LWIP_HTTPD_SSI_RAW
@ -179,7 +182,9 @@ void http_set_ssi_handler(tSSIHandler pfnSSIHandler,
/* These functions must be implemented by the application */
/** Called when a POST request has been received. The application can decide
/**
* @ingroup httpd
* Called when a POST request has been received. The application can decide
* whether to accept it or not.
*
* @param connection Unique connection identifier, valid until httpd_post_end
@ -201,7 +206,9 @@ err_t httpd_post_begin(void *connection, const char *uri, const char *http_reque
u16_t http_request_len, int content_len, char *response_uri,
u16_t response_uri_len, u8_t *post_auto_wnd);
/** Called for each pbuf of data that has been received for a POST.
/**
* @ingroup httpd
* Called for each pbuf of data that has been received for a POST.
* ATTENTION: The application is responsible for freeing the pbufs passed in!
*
* @param connection Unique connection identifier.
@ -211,7 +218,9 @@ err_t httpd_post_begin(void *connection, const char *uri, const char *http_reque
*/
err_t httpd_post_receive_data(void *connection, struct pbuf *p);
/** Called when all data is received or when the connection is closed.
/**
* @ingroup httpd
* Called when all data is received or when the connection is closed.
* The application must return the filename/URI of a file to send in response
* to this POST request. If the response_uri buffer is untouched, a 404
* response is returned.

View File

@ -68,7 +68,7 @@
/** Set this to 1 to support CGI (new style).
*
* This new style CGI support works by calling a global function
* (@ref httpd_cgi_handler) for all URLs that are found. fs_open is called first
* (@ref tCGIHandler) for all URLs that are found. fs_open is called first
* and the URL can not be written by the CGI handler. Instead, this handler gets
* passed the http file state, an object where it can store information derived
* from the CGI URL or parameters. This file state is later passed to SSI, so