From 195eb255e53c8327a743ef89c616c6532d364de2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 8 Jun 2014 12:52:39 +0200 Subject: m + fix: include header value in interception conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/interceptors.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mds-server') diff --git a/src/mds-server/interceptors.c b/src/mds-server/interceptors.c index 38442bd..552d7a1 100644 --- a/src/mds-server/interceptors.c +++ b/src/mds-server/interceptors.c @@ -77,6 +77,7 @@ void add_intercept_condition(client_t* client, char* condition, int64_t priority interception_condition_t* conds = client->interception_conditions; ssize_t nonmodifying = -1; char* header = condition; + char* colon = NULL; char* value; size_t hash; size_t i; @@ -85,11 +86,15 @@ void add_intercept_condition(client_t* client, char* condition, int64_t priority if ((value = strchr(header, ':')) != NULL) { *value = '\0'; /* NUL-terminate header. */ + colon = value; /* End of header. */ value += 2; /* Skip over delimiter. */ } /* Calcuate header hash (comparison optimisation) */ hash = string_hash(header); + /* Undo header–value splitting. */ + if (colon != NULL) + *colon = ':'; /* Remove of update condition of already registered, also look for non-modifying condition to swap position -- cgit v1.2.3-70-g09d2