uhttpd: relax cgi timeout
[project/luci.git] / contrib / package / uhttpd / src / uhttpd-cgi.c
index 7b3337d..4342d27 100644 (file)
@@ -132,7 +132,7 @@ static void uh_cgi_error_500(struct client *cl, struct http_request *req, const
 }
 
 
-void uh_cgi_request(struct client *cl, struct http_request *req, struct uh_path_info *pi)
+void uh_cgi_request(struct client *cl, struct http_request *req, struct path_info *pi)
 {
        int i, hdroff, bufoff;
        int hdrlen = 0;
@@ -248,6 +248,10 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct uh_path_
                                /* request url */
                                setenv("REQUEST_URI", req->url, 1);
 
+                               /* remote user */
+                               if( req->realm )
+                                       setenv("REMOTE_USER", req->realm->user, 1);
+
                                /* request message headers */
                                foreach_header(i, req->headers)
                                {
@@ -353,7 +357,7 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct uh_path_
                                FD_SET(rfd[0], &reader);
                                FD_SET(wfd[1], &writer);
 
-                               timeout.tv_sec = 3;
+                               timeout.tv_sec = 15;
                                timeout.tv_usec = 0;
 
                                /* wait until we can read or write or both */
@@ -516,7 +520,7 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct uh_path_
                                        }
                                }
 
-                               /* no activity for 3 seconds... looks dead */
+                               /* no activity for 15 seconds... looks dead */
                                else
                                {
                                        uh_http_sendhf(cl, 504, "Gateway Timeout",