Changeset 0bc59eeb in github


Ignore:
Timestamp:
Jun 4, 2010 7:05:59 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
dbe49889
Parents:
ccf250e
Message:
  • Fix handling very long THREAD responses
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap_generic.php

    rccf250e r0bc59eeb  
    15071507            $node = array(); 
    15081508            if ($str[$begin] != '(') { 
    1509                     $stop = $begin + strspn($str, "1234567890", $begin, $end - $begin); 
     1509                    $stop = $begin + strspn($str, '1234567890', $begin, $end - $begin); 
    15101510                    $msg = substr($str, $begin, $stop - $begin); 
    15111511                    if ($msg == 0) 
     
    15671567            $algorithm = $algorithm ? trim($algorithm) : 'REFERENCES'; 
    15681568            $criteria  = $criteria ? 'ALL '.trim($criteria) : 'ALL'; 
     1569        $data      = ''; 
    15691570 
    15701571            if (!$this->putLineC("thrd1 THREAD $algorithm $encoding $criteria")) { 
     
    15721573            } 
    15731574            do { 
    1574                     $line = trim($this->readLine(10000)); 
    1575                     if (preg_match('/^\* THREAD/', $line)) { 
    1576                             $str         = trim(substr($line, 8)); 
    1577                         $depthmap    = array(); 
    1578                         $haschildren = array(); 
    1579                             $tree = $this->parseThread($str, 0, strlen($str), null, null, 0, $depthmap, $haschildren); 
     1575                    $line = trim($this->readLine()); 
     1576                    if ($this->startsWith($line, '* THREAD')) { 
     1577                        $data .= substr($line, 9); 
     1578                } else if (preg_match('/^[0-9() ]+$/', $line)) { 
     1579                        $data .= $line; 
    15801580                    } 
    15811581            } while (!$this->startsWith($line, 'thrd1', true, true)); 
     
    15831583        $result_code = $this->parseResult($line); 
    15841584            if ($result_code == 0) { 
    1585             return array($tree, $depthmap, $haschildren); 
     1585            $depthmap    = array(); 
     1586            $haschildren = array(); 
     1587            $tree = $this->parseThread($data, 0, strlen($data), null, null, 0, $depthmap, $haschildren); 
     1588            return array($tree, $depthmap, $haschildren); 
    15861589            } 
    15871590 
Note: See TracChangeset for help on using the changeset viewer.