From dbc8bb8dbc278b80dd13e732da9647c9df856fa4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 13 Dec 2010 20:54:22 +0300 Subject: Implement checking options for modules Implement checking for classifier options Fix redirector to handle timeouts and invalid replies properly Fix surbl module not to check each url --- utils/redirector.pl.in | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils') diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in index be2a0e13d..8f535b406 100755 --- a/utils/redirector.pl.in +++ b/utils/redirector.pl.in @@ -275,6 +275,17 @@ sub process_client { } } } + elsif ($http_response->code != 200) { + _log (LOG_INFO, "HTTP response was %d, for request to %s", $http_response->code, $http_request->uri); + my $new_response = HTTP::Response->new($http_response->code); + + # Avoid sending the response if the client has gone away. + $heap->{client}->put($new_response) if defined $heap->{client}; + + # Shut down the client's connection when the response is sent. + $kernel->yield("shutdown"); + return; + } my $response_type = $http_response->content_type(); if ( $response_type =~ /^text/i ) { my $content = $http_response->decoded_content(); -- cgit v1.2.3