diff --git a/UPGRADING b/UPGRADING index 806b93c7..06917d6b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -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: diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index 276ec245..946bbc5f 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -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 */ ); } diff --git a/src/include/lwip/apps/httpd.h b/src/include/lwip/apps/httpd.h index 1104adea..e0638ff7 100644 --- a/src/include/lwip/apps/httpd.h +++ b/src/include/lwip/apps/httpd.h @@ -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 */