From 0b38d197455c0086513a47c0d3755a155a1a1772 Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 3 Jul 2003 16:18:51 +0000 Subject: [PATCH] Finally nailed down the exchange problem. It was caused by a very stupid mistake from me. I didn't ended the query with \r\n but ended it with \n. I should have known better. An interesting discovery was that setting the number of queries to process at once influence performance. A higher number doesn't mean more performance. In our tests 128 was slower then 32 (on Exchange 2000). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5201 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 3cbf3c7b..819aa293 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -90,7 +90,7 @@ function sqimap_prepare_pipelined_query($new_query,&$tag,&$aQuery,$unique_id) { $sid = sqimap_session_id($unique_id); $tag_uid_a = explode(' ',trim($sid)); $tag = $tag_uid_a[0]; - $query = $sid . ' '.$new_query."\n"; + $query = $sid . ' '.$new_query."\r\n"; $aQuery[$tag] = $query; } @@ -105,6 +105,9 @@ function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors IMAP client or should handle BYE calls if the IMAP-server drops the connection because the number of queries is to large. This isn't tested but a wild guess how it could work in the field. + + After testing it on Exchange 2000 we discovered that a chucksize of 32 + was quicker then when we raised it to 128. */ $iQueryCount = count($aQueryList); $iChunkSize = 32; @@ -134,7 +137,6 @@ function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors fputs($imap_stream,$query); $aResults[$tag] = false; } -// $aQuery = array_reverse($aQuery,true); foreach($aQuery as $tag => $query) { if ($aResults[$tag] == false) { $aReturnedResponse = sqimap_retrieve_imap_response ($imap_stream, $tag, -- 2.25.1