aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@esdenera.com>2015-02-05 09:41:29 +0100
committerReyk Floeter <reyk@esdenera.com>2015-02-05 09:41:29 +0100
commita0f456c3c650c7d5066a64b05a73011ddc12c23a (patch)
tree5c287bbe06afe6427bb62724868722ce79fb516c
parentf8166531e6655bcd2f0514d74dd61e864a8794c3 (diff)
downloadhttpd-a0f456c3c650c7d5066a64b05a73011ddc12c23a.tar.gz
httpd-a0f456c3c650c7d5066a64b05a73011ddc12c23a.zip
Fixing log locations
-rw-r--r--httpd.h1
-rw-r--r--parse.y5
-rw-r--r--server_http.c6
3 files changed, 8 insertions, 4 deletions
diff --git a/httpd.h b/httpd.h
index e1fc20e..fbf125a 100644
--- a/httpd.h
+++ b/httpd.h
@@ -381,6 +381,7 @@ TAILQ_HEAD(serverauth, auth);
struct server_config {
u_int32_t id;
+ u_int32_t parent_id;
char name[HOST_NAME_MAX+1];
char location[NAME_MAX];
char index[NAME_MAX];
diff --git a/parse.y b/parse.y
index d613efd..7be13b1 100644
--- a/parse.y
+++ b/parse.y
@@ -229,6 +229,7 @@ server : SERVER STRING {
strlcpy(s->srv_conf.errorlog, HTTPD_ERROR_LOG,
sizeof(s->srv_conf.errorlog));
s->srv_conf.id = ++last_server_id;
+ s->srv_conf.parent_id = s->srv_conf.id;
s->srv_s = -1;
s->srv_conf.timeout.tv_sec = SERVER_TIMEOUT;
s->srv_conf.maxrequests = SERVER_MAXREQUESTS;
@@ -479,8 +480,9 @@ serveroptsl : LISTEN ON STRING opttls port {
YYERROR;
}
+ s->srv_conf.id = ++last_server_id;
/* A location entry uses the parent id */
- s->srv_conf.id = srv->srv_conf.id;
+ s->srv_conf.parent_id = srv->srv_conf.id;
s->srv_conf.flags = SRVFLAG_LOCATION;
s->srv_s = -1;
memcpy(&s->srv_conf.ss, &srv->srv_conf.ss,
@@ -1809,6 +1811,7 @@ server_inherit(struct server *src, const char *name,
dst->srv_conf.tls_key = NULL;
dst->srv_conf.id = ++last_server_id;
+ dst->srv_conf.parent_id = dst->srv_conf.id;
dst->srv_s = -1;
if (last_server_id == INT_MAX) {
diff --git a/server_http.c b/server_http.c
index 1a48b4a..0113a82 100644
--- a/server_http.c
+++ b/server_http.c
@@ -617,6 +617,8 @@ server_reset_http(struct client *clt)
{
struct server *srv = clt->clt_srv;
+ server_log(clt, NULL);
+
server_httpdesc_free(clt->clt_descreq);
server_httpdesc_free(clt->clt_descresp);
clt->clt_headerlen = 0;
@@ -627,8 +629,6 @@ server_reset_http(struct client *clt)
clt->clt_remote_user = NULL;
clt->clt_bev->readcb = server_read_http;
clt->clt_srv_conf = &srv->srv_conf;
-
- server_log(clt, NULL);
}
ssize_t
@@ -998,7 +998,7 @@ server_getlocation(struct client *clt, const char *path)
}
#endif
if ((location->flags & SRVFLAG_LOCATION) &&
- location->id == srv_conf->id &&
+ location->parent_id == srv_conf->parent_id &&
fnmatch(location->location, path, FNM_CASEFOLD) == 0) {
/* Replace host configuration */
clt->clt_srv_conf = srv_conf = location;