Skip to content

Commit

Permalink
Merge pull request #36 from iainsaxon/defined-curl-transport-timeouts
Browse files Browse the repository at this point in the history
Wrapped timeout constants in conditional checks
  • Loading branch information
nufyoot committed Oct 29, 2014
2 parents afeb627 + 6268402 commit 543e569
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions class/transport.php
Expand Up @@ -4,8 +4,12 @@
define('CS_REST_POST', 'POST');
define('CS_REST_PUT', 'PUT');
define('CS_REST_DELETE', 'DELETE');
define('CS_REST_SOCKET_TIMEOUT', 10);
define('CS_REST_CALL_TIMEOUT', 10);
if (false === defined('CS_REST_SOCKET_TIMEOUT')) {
define('CS_REST_SOCKET_TIMEOUT', 10);
}
if (false === defined('CS_REST_CALL_TIMEOUT')) {
define('CS_REST_CALL_TIMEOUT', 10);
}

function CS_REST_TRANSPORT_get_available($requires_ssl, $log) {
if(function_exists('curl_init') && function_exists('curl_exec')) {
Expand Down Expand Up @@ -328,4 +332,4 @@ function _build_request($call_options, $host, $path, $accept_gzip) {

return $request."\n\n";
}
}
}

0 comments on commit 543e569

Please sign in to comment.