mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08: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
|
* LWIP_HOOK_DHCP_APPEND_OPTIONS() has changed, see description in opt.h (options_out_len is not
|
||||||
available in struct dhcp any more)
|
available in struct dhcp any more)
|
||||||
|
|
||||||
|
* httpd LWIP_HTTPD_CGI_SSI: httpd_cgi_handler() has an additional parameter "struct fs_file *"
|
||||||
|
|
||||||
(2.0.2)
|
(2.0.2)
|
||||||
|
|
||||||
++ Application changes:
|
++ 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);
|
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
|
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
||||||
, hs->handle->state
|
, file->state
|
||||||
#endif /* LWIP_HTTPD_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 || LWIP_HTTPD_CGI_SSI
|
||||||
|
|
||||||
#if 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.
|
/** Define this generic CGI handler in your application.
|
||||||
* It is called once for every URI with parameters.
|
* It is called once for every URI with parameters.
|
||||||
* The parameters can be stored to the object passed as connection_state, which
|
* 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().
|
* 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.
|
* 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
|
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
||||||
, void *connection_state
|
, void *connection_state
|
||||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
#endif /* LWIP_HTTPD_FILE_STATE */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user