Skip to content

Commit

Permalink
Changed CURLOPT_TIMEOUT to 4, and made sure the curl handle is closed…
Browse files Browse the repository at this point in the history
… after every request.
  • Loading branch information
printnode-jake committed Jul 29, 2015
1 parent 409d637 commit 7957c1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/PrintNode/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ private function curlInit()
curl_setopt($curlHandle, CURLOPT_USERPWD, (string)$this->credentials);

curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);

curl_setopt($curlHandle, CURLOPT_TIMEOUT, 4);

curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, true);

Expand All @@ -208,6 +211,8 @@ private function curlExec($curlHandle, $endPointUrl)
);
}

curl_close($curlHandle);

$response_parts = explode("\r\n\r\n", $response);

$content = array_pop($response_parts);
Expand Down

0 comments on commit 7957c1a

Please sign in to comment.