[FASTCGI] Supress error 500 by baiduspider

Thomas H Bowden Jr charles_thomas at mac.com
Sun Apr 7 14:20:20 EDT 2013


In the past , when I have had similar problems there are two ways that i fixed 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… or somehow hadn't actually flushed the buffer in time.

Tom


On Apr 7, 2013, at 10:37 AM, Ross <basarevych at gmail.com> wrote:

> 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?
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers at mailman.fastcgi.com
> http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers



More information about the FastCGI-developers mailing list