diff --git a/httprl.module b/httprl.module index 5657ebb..f807244 100644 --- a/httprl.module +++ b/httprl.module @@ -1048,7 +1048,7 @@ function httprl_send_request($results = NULL) { // No streams are ready from stream_select, See if end server has // dropped the connection, or has failed to make the connection. $socket_name = 'Not empty.'; - if ($empty_runs > 32) { + if ($result->async_connect && $empty_runs > 32) { // If nothing has happened after 32 runs, see if the connection has // been made. $socket_name = stream_socket_get_name($result->fp, TRUE); @@ -1057,7 +1057,7 @@ function httprl_send_request($results = NULL) { // Connection was dropped or connection timed out. if ($timeout <= 0 || empty($socket_name)) { $result->error = $t('Connection timed out. '); - if (empty($socket_name) && $result->async_connect) { + if (empty($socket_name)) { $result->error .= $t('If you believe this is a false error, set async_connect to false in the options array that is passed into httprl_request() and try again.'); } // Stream timed out & the request is not done.