Unverified Commit 06ca1ad9 authored by Nathan Van Overloop's avatar Nathan Van Overloop
Browse files

centralnic/issues#3769: add some more information and better time mgmt

parent ff30e59b
......@@ -105,7 +105,7 @@
}
} else {
if($result === FALSE && $errno == 0){
throw new Exception("Connection could not be opened due to socket problem");
throw new Exception("Connection could not be opened due to socket problem. Reasons can be unmatched peer name, tls not supported...");
}
else {
throw new Exception("Connection could not be opened: $errno $errstr");
......
......@@ -37,11 +37,12 @@ class Net_EPP_Protocol {
// Loop reading and checking info to see if we hit timeout
$info = stream_get_meta_data($socket);
$time_start = microtime(true);
$timeout_time=time()+$GLOBALS['timeout'];
$timeout_time=microtime(true)+$GLOBALS['timeout'];
while (!$info['timed_out'] && !feof($socket)) {
//make sure we don't wait to long
if($timeout_time>time()){
if($timeout_time>microtime(true)){
$time_diff=microtime(true)-$time_start;
throw new exception('Timeout reading from EPP server');
}
// Try read remaining data from socket
......@@ -70,7 +71,6 @@ class Net_EPP_Protocol {
if($GLOBALS['debug']){
$time_diff=microtime(true)-$time_start;
debug_log("returning after {$time_diff}");
}
return $result;
}
......
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