Browse Source

remove redundant calls to end-of-request hooks

The (misnamed) connection_reset hook is always called after a request,
whether request completes or is aborted, and whether keep-alive or not,
so no needed to repeat the same function in the handle_connection_close
hook.
personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
1adf1df285
  1. 1
      src/mod_deflate.c
  2. 1
      src/mod_fastcgi.c
  3. 1
      src/mod_proxy.c
  4. 1
      src/mod_scgi.c
  5. 3
      src/mod_uploadprogress.c
  6. 2
      src/plugin.h

1
src/mod_deflate.c

@ -1245,7 +1245,6 @@ int mod_deflate_plugin_init(plugin *p) {
p->cleanup = mod_deflate_free;
p->set_defaults = mod_deflate_setdefaults;
p->connection_reset = mod_deflate_cleanup;
p->handle_connection_close = mod_deflate_cleanup;
p->handle_response_start = mod_deflate_handle_response_start;
p->data = NULL;

1
src/mod_fastcgi.c

@ -3662,7 +3662,6 @@ int mod_fastcgi_plugin_init(plugin *p) {
p->cleanup = mod_fastcgi_free;
p->set_defaults = mod_fastcgi_set_defaults;
p->connection_reset = fcgi_connection_reset;
p->handle_connection_close = fcgi_connection_reset;
p->handle_uri_clean = fcgi_check_extension_1;
p->handle_subrequest_start = fcgi_check_extension_2;
p->handle_subrequest = mod_fastcgi_handle_subrequest;

1
src/mod_proxy.c

@ -1437,7 +1437,6 @@ int mod_proxy_plugin_init(plugin *p) {
p->cleanup = mod_proxy_free;
p->set_defaults = mod_proxy_set_defaults;
p->connection_reset = mod_proxy_connection_reset; /* end of req-resp cycle */
p->handle_connection_close = mod_proxy_connection_reset; /* end of client connection */
p->handle_uri_clean = mod_proxy_check_extension;
p->handle_subrequest = mod_proxy_handle_subrequest;
p->handle_trigger = mod_proxy_trigger;

1
src/mod_scgi.c

@ -3094,7 +3094,6 @@ int mod_scgi_plugin_init(plugin *p) {
p->cleanup = mod_scgi_free;
p->set_defaults = mod_scgi_set_defaults;
p->connection_reset = scgi_connection_reset;
p->handle_connection_close = scgi_connection_reset;
p->handle_uri_clean = scgi_check_extension_1;
p->handle_subrequest_start = scgi_check_extension_2;
p->handle_subrequest = mod_scgi_handle_subrequest;

3
src/mod_uploadprogress.c

@ -416,8 +416,7 @@ int mod_uploadprogress_plugin_init(plugin *p) {
p->init = mod_uploadprogress_init;
p->handle_uri_clean = mod_uploadprogress_uri_handler;
p->handle_request_done = mod_uploadprogress_request_done;
p->handle_connection_close = mod_uploadprogress_request_done;
p->connection_reset = mod_uploadprogress_request_done;
p->set_defaults = mod_uploadprogress_set_defaults;
p->cleanup = mod_uploadprogress_free;

2
src/plugin.h

@ -54,7 +54,7 @@ typedef struct {
*/
handler_t (* handle_subrequest) (server *srv, connection *con, void *p_d); /* */
handler_t (* handle_response_start) (server *srv, connection *con, void *p_d); /* before response headers are written */
handler_t (* connection_reset) (server *srv, connection *con, void *p_d); /* */
handler_t (* connection_reset) (server *srv, connection *con, void *p_d); /* after request done or request abort */
void *data;
/* dlopen handle */

Loading…
Cancel
Save