mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 09:45:30 +00:00
add curl dns resolver options #15
This commit is contained in:
parent
479c85ea68
commit
28040c934f
2 changed files with 58 additions and 0 deletions
|
|
@ -177,6 +177,18 @@
|
|||
{
|
||||
"max":10485760
|
||||
}
|
||||
},
|
||||
"dns":
|
||||
{
|
||||
"cache":
|
||||
{
|
||||
"timeout":120,
|
||||
"global":false
|
||||
},
|
||||
"shuffle":false,
|
||||
"interface":null,
|
||||
"ip4address":null,
|
||||
"ip6address":null
|
||||
}
|
||||
},
|
||||
"queue":
|
||||
|
|
|
|||
|
|
@ -189,6 +189,52 @@ foreach($index->search('')
|
|||
$document->get('url')
|
||||
);
|
||||
|
||||
// DNS options
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_CACHE_TIMEOUT,
|
||||
$config->cli->document->crawl->curl->dns->cache->timeout
|
||||
);
|
||||
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_USE_GLOBAL_CACHE,
|
||||
$config->cli->document->crawl->curl->dns->cache->global
|
||||
);
|
||||
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_SHUFFLE_ADDRESSES,
|
||||
$config->cli->document->crawl->curl->dns->shuffle
|
||||
);
|
||||
|
||||
if ($config->cli->document->crawl->curl->dns->interface)
|
||||
{
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_INTERFACE,
|
||||
$config->cli->document->crawl->curl->dns->interface
|
||||
);
|
||||
}
|
||||
|
||||
if ($config->cli->document->crawl->curl->dns->ip4address)
|
||||
{
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_LOCAL_IP4,
|
||||
$config->cli->document->crawl->curl->dns->ip4address
|
||||
);
|
||||
}
|
||||
|
||||
if ($config->cli->document->crawl->curl->dns->ip6address)
|
||||
{
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_DNS_LOCAL_IP6,
|
||||
$config->cli->document->crawl->curl->dns->ip6address
|
||||
);
|
||||
}
|
||||
|
||||
// Drop URL with long response
|
||||
curl_setopt(
|
||||
$request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue