Changeset 2739 in subversion for trunk/roundcubemail/program/lib/imap.inc
- Timestamp:
- Jul 11, 2009 5:53:11 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/lib/imap.inc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/lib/imap.inc
r2738 r2739 200 200 global $my_prefs; 201 201 202 if (!empty($my_prefs['debug_mode']))202 if (!empty($my_prefs['debug_mode'])) 203 203 write_log('imap', 'C: '. rtrim($string)); 204 204 … … 247 247 break; 248 248 } 249 if (!empty($my_prefs['debug_mode']))249 if (!empty($my_prefs['debug_mode'])) 250 250 write_log('imap', 'S: '. chop($buffer)); 251 251 $line .= $buffer; … … 278 278 do { 279 279 $d = fread($fp, $bytes-$len); 280 if (!empty($my_prefs['debug_mode'])) 281 write_log('imap', 'S: '. $d); 280 282 $data .= $d; 281 if ($len == strlen($data)) { 283 $data_len = strlen($data); 284 if ($len == $data_len) { 282 285 break; //nothing was read -> exit to avoid apache lockups 283 286 } 284 if(!empty($my_prefs['debug_mode'])) 285 write_log('imap', 'S: '. $d); 286 $len = strlen($data); 287 $len = $data_len; 287 288 } while ($len < $bytes); 288 289 … … 329 330 } 330 331 331 function iil_StartsWithI($string, $match, $ bye=false) {332 function iil_StartsWithI($string, $match, $error=false) { 332 333 $len = strlen($match); 333 334 if ($len == 0) { … … 337 338 return true; 338 339 } 339 if ($ bye && strncmp($string, '* BYE ', 6) == 0) {340 if ($error && preg_match('/^\* (BYE|BAD) /i', $string)) { 340 341 return true; 341 342 … … 792 793 $conn->exists = (int) $a[1]; 793 794 } 794 if (strcasecmp($a[2], 'RECENT') == 0) {795 else if (strcasecmp($a[2], 'RECENT') == 0) { 795 796 $conn->recent = (int) $a[1]; 796 797 } … … 893 894 $command .= $encoding . ' ALL' . $add; 894 895 $line = $data = ''; 895 896 896 897 if (!iil_PutLineC($conn->fp, $command)) { 897 898 return false; … … 2266 2267 $bytes = (int)$sizeStr; 2267 2268 $prev = ''; 2268 2269 2269 2270 while ($bytes > 0) { 2270 2271 $line = iil_ReadLine($fp, 1024); … … 2273 2274 if ($len > $bytes) { 2274 2275 $line = substr($line, 0, $bytes); 2276 $len = strlen($line); 2275 2277 } 2276 $bytes -= strlen($line);2278 $bytes -= $len; 2277 2279 2278 2280 if ($mode == 1) { … … 2353 2355 $line=iil_ReadLine($fp, 300); 2354 2356 } while ($line[0] != 'c'); 2355 $conn->error = $line;2356 2357 return (iil_ParseResult($line) == 0); 2357 2358 } … … 2378 2379 return (iil_ParseResult($line) == 0); 2379 2380 } 2380 $conn->error = "Couldn't send command\n";2381 2381 return false; 2382 2382 }
Note: See TracChangeset
for help on using the changeset viewer.
