aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-30 20:03:18 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-30 20:03:18 +0000
commit865c150cb473fca8ff91d60ddd539ac6dbbe02ee (patch)
tree1ae51b35fbfaa069adf98db8a4c98887bdd3f9a8 /src/http/ngx_http_parse.c
parentc2bba092eb07ea5fcd2e2ee987e3a304f755a3c7 (diff)
downloadnginx-865c150cb473fca8ff91d60ddd539ac6dbbe02ee.tar.gz
nginx-865c150cb473fca8ff91d60ddd539ac6dbbe02ee.zip
nginx-0.0.1-2003-11-30-23:03:18 import
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 17706bb4d..dd97433ed 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -642,6 +642,7 @@ int ngx_http_parse_complex_uri(ngx_http_request_t *r)
state = sw_usual;
p = r->uri_start;
u = r->uri.data;
+ r->uri_ext = NULL;
ch = *p++;
@@ -654,6 +655,7 @@ ngx_log_debug(r->connection->log, "S: %d UN: '%x:%c', URI: '%c'" _
case sw_usual:
switch(ch) {
case '/':
+ r->uri_ext = NULL;
state = sw_slash;
*u++ = ch;
break;
@@ -661,6 +663,8 @@ ngx_log_debug(r->connection->log, "S: %d UN: '%x:%c', URI: '%c'" _
quoted_state = state;
state = sw_quoted;
break;
+ case '.':
+ r->uri_ext = u + 1;
default:
*u++ = ch;
break;
@@ -811,5 +815,17 @@ ngx_log_debug(r->connection->log, "S: %d UN: '%x:%c', URI: '%c'" _
r->uri.len = u - r->uri.data;
r->uri.data[r->uri.len] = '\0';
+ if (r->uri_ext) {
+ r->exten.len = u - r->uri_ext;
+
+ if (!(r->exten.data = ngx_palloc(r->pool, r->exten.len + 1))) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ ngx_cpystrn(r->exten.data, r->uri_ext, r->exten.len + 1);
+ }
+
+ r->uri_ext = NULL;
+
return NGX_OK;
}