mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-30 07:10:35 +00:00
exchanges: add missing timeout curl options
This commit is contained in:
parent
fe4dc4e25a
commit
3489940168
7 changed files with 14 additions and 5 deletions
|
@ -9,6 +9,7 @@ function alcurex_api_query($method, $params='')
|
||||||
$ch = curl_init($uri);
|
$ch = curl_init($uri);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
$execResult = strip_tags(curl_exec($ch));
|
$execResult = strip_tags(curl_exec($ch));
|
||||||
$obj = json_decode($execResult);
|
$obj = json_decode($execResult);
|
||||||
|
|
|
@ -9,6 +9,8 @@ function bitstamp_api_query($method, $params='')
|
||||||
|
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
$execResult = curl_exec($ch);
|
$execResult = curl_exec($ch);
|
||||||
$res = json_decode($execResult, true);
|
$res = json_decode($execResult, true);
|
||||||
|
@ -51,6 +53,7 @@ function bitstamp_api_user($method, $params='')
|
||||||
//curl_setopt($ch, CURLOPT_SSLVERSION, 1 /*CURL_SSLVERSION_TLSv1*/);
|
//curl_setopt($ch, CURLOPT_SSLVERSION, 1 /*CURL_SSLVERSION_TLSv1*/);
|
||||||
curl_setopt($ch, CURLOPT_SSL_SESSIONID_CACHE, 0);
|
curl_setopt($ch, CURLOPT_SSL_SESSIONID_CACHE, 0);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bitstamp API PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bitstamp API PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
||||||
curl_setopt($ch, CURLOPT_ENCODING , '');
|
curl_setopt($ch, CURLOPT_ENCODING , '');
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@ function bter_api_query($method, $params='')
|
||||||
|
|
||||||
$ch = curl_init($uri);
|
$ch = curl_init($uri);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
||||||
|
|
||||||
$data = strip_tags(curl_exec($ch));
|
$data = strip_tags(curl_exec($ch));
|
||||||
if ($method == 'tickers' && empty($params)) {
|
if ($method == 'tickers' && empty($params)) {
|
||||||
|
|
|
@ -12,6 +12,8 @@ function cryptopia_api_query($method, $params='')
|
||||||
|
|
||||||
$ch = curl_init($uri);
|
$ch = curl_init($uri);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
$execResult = curl_exec($ch);
|
$execResult = curl_exec($ch);
|
||||||
$obj = json_decode($execResult);
|
$obj = json_decode($execResult);
|
||||||
|
|
|
@ -8,14 +8,10 @@ function jubi_api_query($method, $params)
|
||||||
$ch = curl_init($uri);
|
$ch = curl_init($uri);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
$execResult = curl_exec($ch);
|
$execResult = curl_exec($ch);
|
||||||
$obj = json_decode($execResult);
|
$obj = json_decode($execResult);
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ function shapeshift_api_query($method, $params='')
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
@ -39,6 +40,7 @@ function shapeshift_api_post($method, $data=array())
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
|
|
@ -6,6 +6,8 @@ function yobit_api_query($method)
|
||||||
|
|
||||||
$ch = curl_init($uri);
|
$ch = curl_init($uri);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
|
||||||
$execResult = curl_exec($ch);
|
$execResult = curl_exec($ch);
|
||||||
$obj = json_decode($execResult);
|
$obj = json_decode($execResult);
|
||||||
|
@ -52,6 +54,7 @@ function yobit_api_query2($method, $req = array())
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; SMART_API PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; SMART_API PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
||||||
curl_setopt($ch, CURLOPT_URL, 'https://yobit.net/tapi/');
|
curl_setopt($ch, CURLOPT_URL, 'https://yobit.net/tapi/');
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue