Commit 01582c48 authored by mikeytown2's avatar mikeytown2

Issue #2749481 by mikeytown2: Allow for cached responses.

parent 4aee328f
......@@ -1204,12 +1204,6 @@ function httprl_request($urls, $options = array()) {
$return[$url] = TRUE;
}
if ($full_bootstrap) {
// Allow other programs to alter the connections before they are made.
// run hook_httprl_request_alter().
drupal_alter('httprl_request', $connections);
}
$results = array();
foreach ($connections as $connection) {
list($socket, $flags, $uri, $url, $options, $result, $request) = $connection;
......@@ -1222,6 +1216,12 @@ function httprl_request($urls, $options = array()) {
$results[] = $result;
}
if ($full_bootstrap) {
// Allow other programs to alter the connections before they are made.
// run hook_httprl_request_alter().
drupal_alter('httprl_request', $results);
}
httprl_send_request($results);
return $return;
}
......@@ -1275,6 +1275,13 @@ function httprl_send_request($results = NULL) {
continue;
}
if (!empty($result->cached)) {
// Used the cached data.
$output[$result->cached->url] = $result->cached;
unset($responses[$id]);
continue;
}
// Get connection limits.
$global_connection_limit = max($global_connection_limit, $result->options['global_connections']);
if (!isset($domain_connection_limit[$result->options['headers']['Host']])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment