diff --git a/httprl.module b/httprl.module index ef51c6c..5f0149b 100644 --- a/httprl.module +++ b/httprl.module @@ -851,17 +851,18 @@ function httprl_request($urls, $options = array()) { $result->chunk_size = 1024; $result->data = ''; + // Setup the default options. + httprl_set_default_options($options); + // Parse the given URL and skip if an error occurred. $uri = httprl_parse_url($url, $result); if (isset($result->error)) { // Put all variables into an array for easy alterations. - $connections[] = array($socket, $flags, $uri, $url, $options, $result, $request); + $connections[] = array(NULL, NULL, $uri, $url, $options, $result, NULL); $return[$url] = FALSE; // Stop processing this request as we have encountered an error. continue; } - // Setup the default options. - httprl_set_default_options($options); // Set the proxy server if one is required. $proxy_server = httprl_setup_proxy($uri, $options, $url); @@ -869,7 +870,7 @@ function httprl_request($urls, $options = array()) { $socket = httprl_set_socket($uri, $options, $proxy_server, $result, $return, $url); if (isset($result->error)) { // Put all variables into an array for easy alterations. - $connections[] = array($socket, $flags, $uri, $url, $options, $result, $request); + $connections[] = array($socket, NULL, $uri, $url, $options, $result, NULL); $return[$url] = FALSE; // Stop processing this request as we have encountered an error. continue; @@ -901,6 +902,7 @@ function httprl_request($urls, $options = array()) { $result->socket = $socket; $result->flags = $flags; $result->uri = $uri; + $result->running_time = 0; $results[] = $result; }