* email: apply timeout for connections for the waiting for data (while no response is comming in) as well

This commit is contained in:
Klaus Leithoff 2011-09-29 10:22:30 +00:00
parent 4d9308bd7e
commit 014c567e2d
3 changed files with 3 additions and 5 deletions

View File

@ -146,7 +146,7 @@ class Net_Socket extends PEAR {
}
$this->fp = $fp;
$this->setTimeout($this->timeout, 0);
return $this->setBlocking($this->blocking);
}
@ -273,7 +273,6 @@ class Net_Socket extends PEAR {
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
return @fgets($this->fp, $size);
}

View File

@ -497,7 +497,7 @@ class defaultimap extends Net_IMAP
*
* @return resource the imap connection
*/
function openConnection($_adminConnection=false)
function openConnection($_adminConnection=false,$_timeout=20)
{
//error_log(__METHOD__.function_backtrace());
unset($this->_connectionErrorObject);
@ -515,7 +515,7 @@ class defaultimap extends Net_IMAP
}
$this->setStreamContextOptions($this->_getTransportOptions());
$this->setTimeout(20);
$this->setTimeout($_timeout);
if( PEAR::isError($status = parent::connect($this->_getTransportString(), $this->port, $this->encryption == 1)) ) {
if ($this->debug) error_log(__METHOD__."Could not connect with ".$this->_getTransportString()." on Port ".$this->port." Encryption==1?".$this->encryption);
if ($this->debug) error_log(__METHOD__."Status connect:".$status->message);

View File

@ -2968,7 +2968,6 @@
//error_log(__METHOD__." using existing Connection ProfileID:".$_icServerID.' Status:'.print_r($this->icServer->_connected,true));
} else {
//error_log( "-------------------------->open connection for Server with profileID:".$_icServerID.function_backtrace());
$this->icServer->_timeout = 5;
$tretval = $this->icServer->openConnection($_adminConnection);
if ( PEAR::isError($tretval) || $tretval===false)
{