From 59cc3d7c047481a0eecd6ccd3241b663d99386aa Mon Sep 17 00:00:00 2001 From: Roberto De Ioris Date: Sat, 20 Oct 2012 20:58:19 +0200 Subject: [PATCH] fixed PATH_INFO usage in embedded http mode --- core/protocol.c | 1 - proto/http.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/protocol.c b/core/protocol.c index 944e7077..a38e528c 100644 --- a/core/protocol.c +++ b/core/protocol.c @@ -1024,7 +1024,6 @@ next: } } - // check for static files // skip extensions diff --git a/proto/http.c b/proto/http.c index 5c350e8c..89bef89b 100644 --- a/proto/http.c +++ b/proto/http.c @@ -137,6 +137,8 @@ static int http_parse(struct wsgi_request *wsgi_req, char *watermark) { wsgi_req->path_info_len = ptr - base; http_url_decode(base, &wsgi_req->path_info_len, wsgi_req->path_info); wsgi_req->uh.pktsize += proto_base_add_uwsgi_var(wsgi_req, "PATH_INFO", 9, wsgi_req->path_info, wsgi_req->path_info_len); + wsgi_req->path_info = (wsgi_req->buffer + wsgi_req->uh.pktsize) - (ptr - base); + wsgi_req->path_info_len = ptr - base; } else { uwsgi_log("not enough space in wsgi_req http proto_parser_buf to encode PATH_INFO, consider tuning it with --buffer-size\n"); @@ -158,6 +160,8 @@ static int http_parse(struct wsgi_request *wsgi_req, char *watermark) { wsgi_req->path_info_len = ptr - base; http_url_decode(base, &wsgi_req->path_info_len, wsgi_req->path_info); wsgi_req->uh.pktsize += proto_base_add_uwsgi_var(wsgi_req, "PATH_INFO", 9, wsgi_req->path_info, wsgi_req->path_info_len); + wsgi_req->path_info = (wsgi_req->buffer + wsgi_req->uh.pktsize) - (ptr - base); + wsgi_req->path_info_len = ptr - base; } else { uwsgi_log("not enough space in wsgi_req http proto_parser_buf to encode PATH_INFO, consider tuning it with --buffer-size\n");