Skip to content

patch broken in nginx 1.2.7 #7

Closed
alexmbird opened this Issue Feb 13, 2013 · 4 comments

4 participants

@alexmbird

Hey there,

I've been using this patch with great success on nginx-1.2.5. But it seems to have broken when applied to 1.2.7:

alex@builder:~/test/nginx-1.2.7$ cat ~/test/nginx_syslog_patch/syslog_1.2.0.patch | patch -p1
patching file src/core/ngx_cycle.c
patching file src/core/ngx_log.c
patching file src/core/ngx_log.h
patching file src/http/modules/ngx_http_log_module.c
Hunk #1 succeeded at 13 with fuzz 2 (offset 4 lines).
Hunk #2 succeeded at 72 (offset 15 lines).
Hunk #3 FAILED at 333.
Hunk #4 succeeded at 1078 (offset 209 lines).
Hunk #5 succeeded at 1110 (offset 212 lines).
Hunk #6 succeeded at 1129 (offset 212 lines).
Hunk #7 succeeded at 1178 (offset 212 lines).
Hunk #8 succeeded at 1231 (offset 212 lines).
Hunk #9 succeeded at 1256 (offset 212 lines).
1 out of 9 hunks FAILED -- saving rejects to file src/http/modules/ngx_http_log_module.c.rej
patching file src/http/ngx_http_core_module.c
Hunk #1 succeeded at 1451 (offset 1 line).
Hunk #2 succeeded at 4767 (offset 107 lines).
Hunk #3 succeeded at 4785 (offset 107 lines).
Hunk #4 succeeded at 4824 (offset 107 lines).
patching file src/http/ngx_http_request.c
Hunk #2 succeeded at 1837 (offset 15 lines).

The contents of src/http/modules/ngx_http_log_module.c.rej are:

--- src/http/modules/ngx_http_log_module.c
+++ src/http/modules/ngx_http_log_module.c
@@ -333,11 +343,27 @@
     time_t      now;
     ssize_t     n;
     ngx_err_t   err;
-
+    
+#if (NGX_ENABLE_SYSLOG)
+    n = 0;
+    if (log->syslog_on) {
+        syslog(log->priority, "%.*s", (int)len, buf);
+    }
+#endif
+     
     if (log->script == NULL) {
         name = log->file->name.data;
+#if (NGX_ENABLE_SYSLOG)
+        if (name != NULL) {
+            n = ngx_write_fd(log->file->fd, buf, len);
+        }
+        else {
+            n = len;
+        }
+#else
         n = ngx_write_fd(log->file->fd, buf, len);

+#endif
     } else {
         name = NULL;
         n = ngx_http_log_script_write(r, log->script, &name, buf, len);
@morfoh
morfoh commented Feb 20, 2013

I can confirm that it is not applying on top of 1.2.7!

Here is a link to the commit where I add a patch for the patch ;) fixing the issue

OpenSDE/package-nopast@e2e7889

@yaoweibin
Owner
@scottlarson

Has there been any progress on this? I've been manually massaging the port on my FreeBSD package build server but it would be super to toss a patch to the official port maintainer to get it flipped back on for real.

@yaoweibin
Owner

Fixed in b2198a2

@yaoweibin yaoweibin closed this Mar 10, 2013
@splitice splitice referenced this issue Jul 10, 2013
Open

NGINX 1.5 #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.