Changeset 4128 in subversion


Ignore:
Timestamp:
Oct 25, 2010 3:45:35 AM (3 years ago)
Author:
alec
Message:
  • Improve performance by reading optional capability response from AUTHENTICATE
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap_generic.php

    r4126 r4128  
    120120 
    121121    const COMMAND_NORESPONSE = 1; 
     122    const COMMAND_CAPABILITY = 2; 
    122123 
    123124    /** 
     
    477478            // RFC 4959 (SASL-IR): save one round trip 
    478479            if ($this->getCapability('SASL-IR')) { 
    479                 $result = $this->execute("AUTHENTICATE PLAIN", array($reply), self::COMMAND_NORESPONSE); 
     480                $result = $this->execute("AUTHENTICATE PLAIN", array($reply), 
     481                    self::COMMAND_NORESPONSE | self::COMMAND_CAPABILITY); 
    480482            } 
    481483            else { 
     
    495497 
    496498        if ($result == self::ERROR_OK) { 
     499            // optional CAPABILITY response 
     500                if ($line && preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches)) { 
     501                        $this->parseCapability($matches[1]); 
     502                } 
    497503            return $this->fp; 
    498504        } 
     
    515521    { 
    516522        list($code, $response) = $this->execute('LOGIN', array( 
    517             $this->escape($user), $this->escape($password))); 
     523            $this->escape($user), $this->escape($password)), self::COMMAND_CAPABILITY); 
    518524 
    519525        // re-set capabilities list if untagged CAPABILITY response provided 
     
    28032809        } 
    28042810 
     2811            // optional CAPABILITY response 
     2812            if (($options & self::COMMAND_CAPABILITY) && $code == self::ERROR_OK 
     2813            && preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches) 
     2814        ) { 
     2815                    $this->parseCapability($matches[1]); 
     2816            } 
     2817 
    28052818            return $noresp ? $code : array($code, $response); 
    28062819    } 
Note: See TracChangeset for help on using the changeset viewer.