mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
httpd: add "struct file*" parameter to httpd_cgi_handler() callback
This commit is contained in:
parent
ab281cb750
commit
6706b3778e
@ -49,6 +49,8 @@ with newer versions.
|
||||
* LWIP_HOOK_DHCP_APPEND_OPTIONS() has changed, see description in opt.h (options_out_len is not
|
||||
available in struct dhcp any more)
|
||||
|
||||
* httpd LWIP_HTTPD_CGI_SSI: httpd_cgi_handler() has an additional parameter "struct fs_file *"
|
||||
|
||||
(2.0.2)
|
||||
|
||||
++ Application changes:
|
||||
|
@ -2304,9 +2304,9 @@ http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const cha
|
||||
{
|
||||
count = extract_uri_parameters(hs, params);
|
||||
}
|
||||
httpd_cgi_handler(uri, count, http_cgi_params, http_cgi_param_vals
|
||||
httpd_cgi_handler(file, uri, count, http_cgi_params, http_cgi_param_vals
|
||||
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
||||
, hs->handle->state
|
||||
, file->state
|
||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
||||
);
|
||||
}
|
||||
|
@ -102,13 +102,17 @@ void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers);
|
||||
#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI
|
||||
|
||||
#if LWIP_HTTPD_CGI_SSI
|
||||
/* we have to prototype this struct here to make it available for the handler */
|
||||
struct fs_file;
|
||||
|
||||
/** Define this generic CGI handler in your application.
|
||||
* It is called once for every URI with parameters.
|
||||
* The parameters can be stored to the object passed as connection_state, which
|
||||
* is allocated to file->state via fs_state_init() from fs_open() or fs_open_custom().
|
||||
* Content creation via SSI or complete dynamic files can retrieve the CGI params from there.
|
||||
*/
|
||||
extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, char **pcValue
|
||||
extern void httpd_cgi_handler(struct fs_file *file, const char* uri, int iNumParams,
|
||||
char **pcParam, char **pcValue
|
||||
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
||||
, void *connection_state
|
||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
||||
|
Loading…
Reference in New Issue
Block a user