Browse Source

[mod_cgi] cgi.local-redir request_reset thru fnptr

cgi.local-redir call plugins_request_reset through fn ptr

(isolate plugins_* funcs to server;
 should not be called directly from plugins/modules)
master
Glenn Strauss 4 months ago
parent
commit
cc65a21e12
  1. 2
      src/base.h
  2. 2
      src/http_cgi.c
  3. 2
      src/mod_cgi.c
  4. 1
      src/server.c

2
src/base.h

@ -178,6 +178,8 @@ struct server {
/* members used at start-up or rarely used */
handler_t (* plugins_request_reset)(request_st *r);/*(for cgi.local-redir)*/
server_config srvconf;
void *config_data_base;

2
src/http_cgi.c

@ -81,7 +81,7 @@ http_cgi_local_redir (request_st * const r)
/*(caller must reset request as follows)*/
/*http_response_reset(r);*/ /*(sets r->http_status = 0)*/
/*plugins_call_handle_request_reset(r);*/
/*r->con->srv->plugins_request_reset(r);*/
return HANDLER_COMEBACK;
}

2
src/mod_cgi.c

@ -555,7 +555,7 @@ static handler_t cgi_local_redir(request_st * const r, handler_ctx * const hctx)
buffer_clear(hctx->response);
chunk_buffer_yield(hctx->response);
http_response_reset(r); /*(includes r->http_status = 0)*/
plugins_call_handle_request_reset(r);
r->con->srv->plugins_request_reset(r);
/*cgi_connection_close(hctx);*//*(already cleaned up and hctx is now invalid)*/
return HANDLER_COMEBACK;
}

1
src/server.c

@ -321,6 +321,7 @@ static server *server_init(void) {
config_init(srv);
srv->request_env = plugins_call_handle_request_env;
srv->plugins_request_reset = plugins_call_handle_request_reset;
srv->loadavg[0] = 0.0;
srv->loadavg[1] = 0.0;

Loading…
Cancel
Save