Changeset 462de2d in github


Ignore:
Timestamp:
Apr 17, 2011 5:22:03 AM (2 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
968754b
Parents:
f62468d
Message:
  • PEAR::Net_SMTP 1.5.2, fixed timeout issue (#1487843)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    ref27a6a r462de2d  
    22=========================== 
    33 
     4- PEAR::Net_SMTP 1.5.2, fixed timeout issue (#1487843) 
    45- Added plugin hook for request token creation 
    56- Replace LDAP vars in group queries (#1487837) 
     
    1819- TinyMCE 3.4.1 
    1920- Stateless request tokens. No keep-alive necessary on login page (#1487829) 
    20 - PEAR::Net_SMTP 1.5.1 
    2121- Allow multiple concurrent compose sessions 
    2222- Force names of unique constraints in PostgreSQL DDL 
  • program/include/rcube_smtp.php

    re8d5bdc r462de2d  
    106106    $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host); 
    107107 
    108     if($RCMAIL->config->get('smtp_debug')) 
     108    if ($RCMAIL->config->get('smtp_debug')) 
    109109      $this->conn->setDebug(true, array($this, 'debug_handler')); 
    110110 
     
    117117      $this->conn = null; 
    118118      return false; 
     119    } 
     120 
     121    // workaround for timeout bug in Net_SMTP 1.5.[0-1] (#1487843) 
     122    if (method_exists($this->conn, 'setTimeout') 
     123      && ($timeout = ini_get('default_socket_timeout')) 
     124    ) { 
     125      $this->conn->setTimeout($timeout); 
    119126    } 
    120127 
  • program/lib/Net/SMTP.php

    r3e63a0b8 r462de2d  
    107107 
    108108    /** 
     109     * Array of socket options that will be passed to Net_Socket::connect(). 
     110     * @see stream_context_create() 
     111     * @var array 
     112     * @access private 
     113     */ 
     114    var $_socket_options = null; 
     115 
     116    /** 
    109117     * The socket I/O timeout value in seconds. 
    110118     * @var int 
     
    157165     * @param boolean $pipeling   Use SMTP command pipelining 
    158166     * @param integer $timeout    Socket I/O timeout in seconds. 
     167     * @param array   $socket_options Socket stream_context_create() options. 
    159168     * 
    160169     * @access  public 
     
    162171     */ 
    163172    function Net_SMTP($host = null, $port = null, $localhost = null, 
    164         $pipelining = false, $timeout = 0) 
     173        $pipelining = false, $timeout = 0, $socket_options = null) 
    165174    { 
    166175        if (isset($host)) { 
     
    176185 
    177186        $this->_socket = new Net_Socket(); 
     187        $this->_socket_options = $socket_options; 
    178188        $this->_timeout = $timeout; 
    179189 
     
    406416        $this->_greeting = null; 
    407417        $result = $this->_socket->connect($this->host, $this->port, 
    408                                           $persistent, $timeout); 
     418                                          $persistent, $timeout, 
     419                                          $this->_socket_options); 
    409420        if (PEAR::isError($result)) { 
    410421            return PEAR::raiseError('Failed to connect socket: ' . 
     
    418429         * and all other socket operations. 
    419430         */ 
    420         if (PEAR::isError($error = $this->setTimeout($this->_timeout))) { 
    421             return $error; 
     431        if ($this->_timeout > 0) { 
     432            if (PEAR::isError($error = $this->setTimeout($this->_timeout))) { 
     433                return $error; 
     434            } 
    422435        } 
    423436 
Note: See TracChangeset for help on using the changeset viewer.