Index: src/response.c =================================================================== --- src/response.c (revision 2969) +++ src/response.c (working copy) @@ -248,7 +248,6 @@ if (con->conf.log_condition_handling) { log_error_write(srv, __FILE__, __LINE__, "s", "run condition"); } - config_patch_connection(srv, con, COMP_SERVER_SOCKET); /* SERVERsocket */ /** * prepare strings @@ -281,15 +280,6 @@ buffer_copy_string_buffer(con->uri.authority, con->request.http_host); buffer_to_lower(con->uri.authority); - config_patch_connection(srv, con, COMP_HTTP_SCHEME); /* Scheme: */ - config_patch_connection(srv, con, COMP_HTTP_HOST); /* Host: */ - config_patch_connection(srv, con, COMP_HTTP_REMOTE_IP); /* Client-IP */ - config_patch_connection(srv, con, COMP_HTTP_REFERER); /* Referer: */ - config_patch_connection(srv, con, COMP_HTTP_USER_AGENT);/* User-Agent: */ - config_patch_connection(srv, con, COMP_HTTP_LANGUAGE); /* Accept-Language: */ - config_patch_connection(srv, con, COMP_HTTP_COOKIE); /* Cookie: */ - config_patch_connection(srv, con, COMP_HTTP_REQUEST_METHOD); /* REQUEST_METHOD */ - /** their might be a fragment which has to be cut away */ if (NULL != (qstr = strchr(con->request.uri->ptr, '#'))) { con->request.uri->used = qstr - con->request.uri->ptr; @@ -321,8 +311,18 @@ buffer_path_simplify(con->uri.path, srv->tmp_buf); } - config_patch_connection(srv, con, COMP_HTTP_URL); /* HTTPurl */ - config_patch_connection(srv, con, COMP_HTTP_QUERY_STRING); /* HTTPqs */ + /** apply specific configurations to this connection */ + con->conditional_is_valid[COMP_SERVER_SOCKET] = 1; /* SERVERsocket */ + con->conditional_is_valid[COMP_HTTP_HOST] = 1; /* Scheme: */ + con->conditional_is_valid[COMP_HTTP_REMOTE_IP] = 1; /* Host: */ + con->conditional_is_valid[COMP_HTTP_REFERER] = 1; /* Client-IP: */ + con->conditional_is_valid[COMP_HTTP_USER_AGENT] = 1; /* Referer: */ + con->conditional_is_valid[COMP_HTTP_LANGUAGE] = 1; /* User-Agent: */ + con->conditional_is_valid[COMP_HTTP_COOKIE] = 1; /* Cookie: */ + con->conditional_is_valid[COMP_HTTP_REQUEST_METHOD] = 1; /* REQUEST_METHOD */ + con->conditional_is_valid[COMP_HTTP_URL] = 1; /* HTTPurl */ + con->conditional_is_valid[COMP_HTTP_QUERY_STRING] = 1; /* HTTPqs */ + config_patch_connection(srv, con); #ifdef USE_OPENSSL if (con->srv_socket->is_ssl && con->conf.ssl_verifyclient) { Index: src/configfile.c =================================================================== --- src/configfile.c (revision 2969) +++ src/configfile.c (working copy) @@ -367,11 +367,9 @@ return 0; } -int config_patch_connection(server *srv, connection *con, comp_key_t comp) { +int config_patch_connection(server *srv, connection *con) { size_t i, j; - con->conditional_is_valid[comp] = 1; - /* skip the first, the global context */ for (i = 1; i < srv->config_context->used; i++) { data_config *dc = (data_config *)srv->config_context->data[i]; Index: src/network.c =================================================================== --- src/network.c (revision 2969) +++ src/network.c (working copy) @@ -108,9 +108,10 @@ config_cond_cache_reset(srv, con); config_setup_connection(srv, con); - config_patch_connection(srv, con, COMP_SERVER_SOCKET); - config_patch_connection(srv, con, COMP_HTTP_SCHEME); - config_patch_connection(srv, con, COMP_HTTP_HOST); + con->conditional_is_valid[COMP_SERVER_SOCKET] = 1; + con->conditional_is_valid[COMP_HTTP_SCHEME] = 1; + con->conditional_is_valid[COMP_HTTP_HOST] = 1; + config_patch_connection(srv, con); if (NULL == con->conf.ssl_pemfile_x509 || NULL == con->conf.ssl_pemfile_pkey) { /* x509/pkey available <=> pemfile was set <=> pemfile got patched: so this should never happen, unless you nest $SERVER["socket"] */ Index: src/plugin.h =================================================================== --- src/plugin.h (revision 2969) +++ src/plugin.h (working copy) @@ -85,7 +85,7 @@ int config_insert_values_global(server *srv, array *ca, const config_values_t *cv); int config_insert_values_internal(server *srv, array *ca, const config_values_t *cv); int config_setup_connection(server *srv, connection *con); -int config_patch_connection(server *srv, connection *con, comp_key_t comp); +int config_patch_connection(server *srv, connection *con); int config_check_cond(server *srv, connection *con, data_config *dc); int config_append_cond_match_buffer(connection *con, data_config *dc, buffer *buf, int n);