[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 2019-10-10 03:34:46 -04:00
parent 78a6440492
commit e01f995ce3
2 changed files with 3 additions and 1 deletions

View File

@ -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 */

View File

@ -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");