Re: Supress error 500 by baiduspider
Ross <[email protected]> Sun, 7 Apr 2013 18:37:40 +0300
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <CANmv3=yQ37kWDaFXGSX9C42fzTOYaoN9UVAv5VY7idqUPke4aw@mail.gmail.com> |
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 = 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?