[sheepdog] [PATCH 2/4] http: use REQUEST_URI instead of DOCUMENT_URI

Liu Yuan namei.unix at gmail.com
Thu Nov 14 10:03:52 CET 2013


Current code will segfault if we don't specify DOCUMENT_URI in nginx conf file.
And we should use REQUEST_URI because REQUEST_URI includes the Query String
(?q=testing...) where DOCUMENT_URI does not. ? is needed for container list
operation.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/http/http.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sheep/http/http.c b/sheep/http/http.c
index aaaec18..8532378 100644
--- a/sheep/http/http.c
+++ b/sheep/http/http.c
@@ -163,7 +163,10 @@ static int request_init_operation(struct http_request *req)
 		sd_err("invalid content_length %s", p);
 		return BAD_REQUEST;
 	}
-	req->uri = FCGX_GetParam("DOCUMENT_URI", env);
+	req->uri = FCGX_GetParam("REQUEST_URI", env);
+	if (!req->uri)
+		return BAD_REQUEST;
+
 	req->status = UNKNOWN;
 
 	return OK;
-- 
1.7.9.5




More information about the sheepdog mailing list