]> git.mjollnir.org Git - s9y.git/commitdiff
Use readTimeout HTTP::Request option to reduce timeout issues,
authorgarvinhicking <garvinhicking>
Tue, 10 Apr 2007 07:16:27 +0000 (07:16 +0000)
committergarvinhicking <garvinhicking>
Tue, 10 Apr 2007 07:16:27 +0000 (07:16 +0000)
by isotopp (http://blog.koehntopp.de/archives/1651-Trackback-spam-swamping-my-apache....html)

plugins/serendipity_event_spamblock/serendipity_event_spamblock.php

index 225697a30028d3bde4b95692c33a0b77c345aad4..48068faea418651130370a82a334e39740c2901f 100644 (file)
@@ -39,7 +39,7 @@ var $filter_defaults;
             'smarty'      => '2.6.7',
             'php'         => '4.1.0'
         ));
-        $propbag->add('version',       '1.66');
+        $propbag->add('version',       '1.67');
         $propbag->add('event_hooks',    array(
             'frontend_saveComment' => true,
             'external_plugin'      => true,
@@ -444,7 +444,8 @@ var $filter_defaults;
                     'http'              => '1.1',
                     'timeout'           => 20,
                     'allowRedirects'    => true,
-                    'maxRedirects'      => 3
+                    'maxRedirects'      => 3,
+                    'readTimeout'       => array(5,0), 
                 );
 
                 $req    = &new HTTP_Request(
@@ -814,7 +815,7 @@ var $filter_defaults;
                             require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
 
                             if (function_exists('serendipity_request_start')) serendipity_request_start();
-                            $req     = &new HTTP_Request($addData['url'], array('allowRedirects' => true, 'maxRedirects' => 5));
+                            $req     = &new HTTP_Request($addData['url'], array('allowRedirects' => true, 'maxRedirects' => 5, 'readTimeout' => array(5,0)));
                             $is_valid = false;
                             if (PEAR::isError($req->sendRequest()) || $req->getResponseCode() != '200') {
                                 $is_valid = false;