[core] run config_setup_connection() fewer times

config_setup_connection() is run when con struct is init'd and in
connection_reset(), after each request is processed.  It also must be
called upon HANDLER_COMEBACK when the request needs to be re-parsed,
but it need not be run twice in common scenario without HANDLER_COMEBACK
personal/stbuehler/ci-build
Glenn Strauss 3 years ago
parent 78a6440492
commit e01f995ce3
  1. 3
      src/connections.c
  2. 1
      src/response.c

@ -1222,6 +1222,9 @@ static int connection_handle_request(server *srv, connection *con) {
connection_fdwaitqueue_append(srv, con);
break;
case HANDLER_COMEBACK:
if (con->mode == DIRECT && buffer_is_empty(con->physical.path)) {
config_setup_connection(srv, con);
}
return 1;
case HANDLER_ERROR:
/* something went wrong */

@ -306,7 +306,6 @@ handler_t http_response_prepare(server *srv, connection *con) {
if (!con->async_callback) {
config_cond_cache_reset(srv, con);
config_setup_connection(srv, con); /* Perhaps this could be removed at other places. */
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "run condition");

Loading…
Cancel
Save