[FASTCGI] Supress error 500 by baiduspider

Ross basarevych at gmail.com
Sun Apr 7 11:37:40 EDT 2013


On Sun, Apr 7, 2013 at 4:07 PM, Jay Sprenkle <jsprenkle at gmail.com> wrote:
> This is the simplest solution:
>
> cat error.log | grep -i "client stopped connection before send" >
> FilterError.log

Well, my logs are analyzed by OSSEC, so I have to patch either OSSEC
or mod_fastcgi anyway.

OSSEC parses all of my access.log's and reports things like status
500. So I need to get rid of it (after all it's not really the server
problem it's just the client killing the socket). And I want to keep a
record for this in error.log just in case (it isn't monitored by
OSSEC).

Here is what I have so far:

--- mod_fastcgi.c.orig  2013-04-06 12:33:07.747545365 +0300
+++ mod_fastcgi.c       2013-04-06 12:37:20.973544222 +0300
@@ -2679,8 +2679,13 @@
     }

     /* Process the fastcgi-script request */
-    if ((ret = do_work(r, fr)) != OK)
+    if ((ret = do_work(r, fr)) != OK) {
+        if (ret == 53) {
+            ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, "FastCGI:
Suppressed error 53");
+            return OK;
+        }
         return ret;
+    }

     /* Special case redirects */
     ret = post_process_for_redirects(r, fr);

It doesn't work. Can you help me with this patch please?


More information about the FastCGI-developers mailing list