diff --git a/httprl.module b/httprl.module index 5f0149b..22864f9 100644 --- a/httprl.module +++ b/httprl.module @@ -1120,9 +1120,9 @@ function httprl_send_request($results = NULL) { // Set the read and write vars to the streams var. $read = $write = $this_run; $except = array(); - // Do some voodoo and open all streams at once. Wait 25ms for streams to + // Do some voodoo and open all streams at once. Wait 200ms for streams to // respond. - $n = stream_select($read, $write, $except, $stream_select_timeout, 25000); + $n = stream_select($read, $write, $except, $stream_select_timeout, 200000); $stream_select_timeout = 0; // We have some streams to read/write to. @@ -1173,6 +1173,7 @@ function httprl_send_request($results = NULL) { // Now that we have the headers, increase the chunk size. $responses[$id]->chunk_size = $responses[$id]->options['chunk_size_read']; + // We could kill the connection here if we only want to mimic a HEAD request. } } @@ -1263,9 +1264,9 @@ function httprl_send_request($results = NULL) { else { $empty_runs++; } - if ($empty_runs > 100) { + if ($empty_runs > 20) { // If stream_select hasn't returned a valid read or write stream after - // 2.5+ seconds, error out. + // 4+ seconds, error out. foreach ($this_run as $id => $fp) { // stream_select timed out & the request is not done. $responses[$id]->error = $t('stream_select() timed out.'); @@ -1277,8 +1278,8 @@ function httprl_send_request($results = NULL) { } } if (!$rw_done) { - // Wait 5ms for data buffers. - usleep(5000); + // Wait 50ms for data buffers. + usleep(50000); } }