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 <[email protected]>
---
 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

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to