Closed Bug 218874 Opened 21 years ago Closed 21 years ago

Make IMAP use blocking reads

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Bienvenu, Assigned: Bienvenu)

References

Details

Attachments

(1 file, 1 obsolete file)

Since the imap protocol code is on its own thread, it can use blocking reads
instead of using async reads and having necko proxy the data over with ODA
calls. It will simplify the code quite a bit, and should speed it up as well, on
a high speed network. I have this working in my tree. Patch upcoming
Attached patch work in progress (obsolete) — Splinter Review
this seems to work reasonably well, and gives a pretty good speedup on a LAN
connection
I need to remove some of the commented out code.I think I can get rid of the
m_pump stuff too. We might want to look into using the synchronous cache methods
as well.
Attached patch proposed fixSplinter Review
this patch is ready for review. I've tried SSL, connecting to a server that
doesn't accept connections, etc, and everything seems OK. Performance seems
better too.
Attachment #131197 - Attachment is obsolete: true
Comment on attachment 131257 [details] [diff] [review]
proposed fix

requesting reviews
Attachment #131257 - Flags: superreview?(scott)
Attachment #131257 - Flags: review?(darin)
Comment on attachment 131257 [details] [diff] [review]
proposed fix

You commented out these two lines:

+//    if (m_chunkSize > m_maxChunkSize)
+//	 m_chunkSize = m_maxChunkSize;

are they save to outright remove or should we document why we think we can
comment them out?
ah, good one - I'll just remove them and add a comment.
Attachment #131257 - Flags: superreview?(scott) → superreview+
Comment on attachment 131257 [details] [diff] [review]
proposed fix

this also looks good to me.   looks like you also left GetThreadEventQueue
commented out in nsIImapProtocol, and that can probably be removed as well. 
i'm going to give this patch a whirl ;)
Attachment #131257 - Flags: review?(darin) → review+
great, thx, I've removed the commented out line from nsIImapProtocol.idl
Status: NEW → ASSIGNED
ship it!  this thing feels sooo much faster!!
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
From RFC 3501:
"Server data MAY be sent as a result of a client command, or MAY be sent
unilaterally by the server."
"A client MUST be prepared to accept any server response at all times. This
includes server data that was not requested."

This fix makes it impossible to implement features like the IDLE command (bug
141369) and what about autologout notifications from the server, these messages
won't be handled (if at all) by the client until the clients performs some kind
of action.
this fix doesn't really change the way the imap parsing code was working,
actually. I believe idle connections could occasionally poll and see if there's
data to read from the socket, and if so, read it.
I know the parsing was already done in a blocking way not using the async as
async so in that perspective this fix makes the code better. But in my opinion
all data from the server should be handled asynchronously (which would require a
probably too big a rewrite). Ah well, I guess I could live with polling although
it seems a bit unnessecary to me when you could be notified of data waiting to
be processed.
This caused regression bug 219185
Blocks: 219336
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: