]> git.kaiwu.me - nginx.git/commitdiff
r1657 merge:
authorIgor Sysoev <igor@sysoev.ru>
Wed, 12 Dec 2007 21:05:17 +0000 (21:05 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 12 Dec 2007 21:05:17 +0000 (21:05 +0000)
log entire request line instead of URI only

src/http/ngx_http_request.c

index 0af46337ed0adfec556f06bddd9abc468d66de1b..e5628f23aeb2421255fa758c698f3645e3016593 100644 (file)
@@ -2599,28 +2599,21 @@ ngx_http_log_error_handler(ngx_http_request_t *r, ngx_http_request_t *sr,
         buf = p;
     }
 
-    if (r->unparsed_uri.data) {
-        p = ngx_snprintf(buf, len, ", URL: \"%V\"", &r->unparsed_uri);
-        len -= p - buf;
-        buf = p;
-
-    } else {
-        if (r->request_line.data == NULL && r->request_start) {
-            for (p = r->request_start; p < r->header_in->last; p++) {
-                if (*p == CR || *p == LF) {
-                    break;
-                }
+    if (r->request_line.data == NULL && r->request_start) {
+        for (p = r->request_start; p < r->header_in->last; p++) {
+            if (*p == CR || *p == LF) {
+                break;
             }
-
-            r->request_line.len = p - r->request_start;
-            r->request_line.data = r->request_start;
         }
 
-        if (r->request_line.len) {
-            p = ngx_snprintf(buf, len, ", request: \"%V\"", &r->request_line);
-            len -= p - buf;
-            buf = p;
-        }
+        r->request_line.len = p - r->request_start;
+        r->request_line.data = r->request_start;
+    }
+
+    if (r->request_line.len) {
+        p = ngx_snprintf(buf, len, ", request: \"%V\"", &r->request_line);
+        len -= p - buf;
+        buf = p;
     }
 
     if (r != sr) {