Re: Supress error 500 by baiduspider

Thomas H Bowden Jr <[email protected]> Sun, 07 Apr 2013 13:20:20 -0500
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
In the past , when I have had similar problems there are two ways that i fi=
xed it:

1) Increased the timeout on response (premise being that it was Apache and =
not fastcgi that terminated message before completion).

2) set the socket to unbuffered output (premise being that application was =
outputting line without a final \r\n=85 or somehow hadn't actually flushed =
the buffer in time.

Tom


On Apr 7, 2013, at 10:37 AM, Ross <[email protected]> wrote:

> On Sun, Apr 7, 2013 at 4:07 PM, Jay Sprenkle <[email protected]> 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 =3D do_work(r, fr)) !=3D OK)
> +    if ((ret =3D do_work(r, fr)) !=3D OK) {
> +        if (ret =3D=3D 53) {
> +            ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, "FastCGI:
> Suppressed error 53");
> +            return OK;
> +        }
>         return ret;
> +    }
> =

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

> It doesn't work. Can you help me with this patch please?
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
> http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers