Ticket #765 enhancement closed fixed

Opened 9 years ago

Last modified 9 years ago

Added Timeout checking to IMAP4Client

Reported by: bkirsch Owned by:
Priority: normal Milestone:
Component: Keywords:
Cc: exarkun, bkirsch Branch:
Author: Launchpad Bug:

Description


Attachments

imap4.diff Download (1.3 KB) - added by bkirsch 9 years ago.
imap4.2.diff Download (2.1 KB) - added by bkirsch 9 years ago.
imap4.3.diff Download (2.6 KB) - added by bkirsch 9 years ago.
test_imap.diff Download (1.8 KB) - added by bkirsch 9 years ago.
imap4.4.diff Download (2.6 KB) - added by bkirsch 9 years ago.

Change History

Changed 9 years ago by bkirsch

1

Changed 9 years ago by bkirsch

The IMAP4Client will hang if the server stop returning responses. Added timeout
to prevent this from 
happening. By default the timeout is set to 0 which means no timeout checking
will be performed. 
Set timeout to >0 for the feature to be active. This prevents unexpected
behavior from current 
IMAP4Client users.

2

Changed 9 years ago by exarkun

This patch causes the client to disconnect, but it doesn't do anything with any
outstanding Deferreds.  These should all have their errbacks invoked with a
timeout exception of some sort.

Also, rawDataReceived needs to call resetTimeout, like lineReceived does, since
during message body receipt, lineReceived will not be invoked.

Unit tests would be great, too.

Changed 9 years ago by bkirsch

3

Changed 9 years ago by bkirsch

Updated Diff that adds a timeout for rawDataReceived and errbacks any deferred commands in the 
self.queued buffer

Changed 9 years ago by bkirsch

Changed 9 years ago by bkirsch

4

Changed 9 years ago by bkirsch

Ok here is the final imap4.py diff.

5

Changed 9 years ago by bkirsch

Ok here is the test_imap.py test case diff

Changed 9 years ago by bkirsch

6

Changed 9 years ago by bkirsch

Added a check to make sure the lastCmd deferred has not already been called :)

Changed 9 years ago by bkirsch

7

Changed 9 years ago by exarkun

Committed at revision 

I made a couple minor changes to the patch before committing.  Most notably, I
suspect, I removed the string from the TimeoutError() constructor.  I think a
user-friendly messages belongs somewhere else.

8

Changed 9 years ago by exarkun

Committed at revision 12474

I made a couple minor changes to the patch before committing.  Most notably, I
suspect, I removed the string from the TimeoutError() constructor.  I think a
user-friendly messages belongs somewhere else.

9

Changed 3 years ago by <automation>

  • owner exarkun deleted
Note: See TracTickets for help on using tickets.