[Twisted-Python] Re: IMAP fixes

Jp Calderone exarkun at intarweb.us
Thu Jul 3 05:11:22 EDT 2003

On Wed, Jul 02, 2003 at 11:14:22PM +0200, Anders Hammarquist wrote:
> Hi!
> Here are the changes for handling literals I talked about earlier.
> So far I've only looked at the server part, but it seems to work
> nicely. There's still work to do on improving the argument parser
> functions, as some arguments can probably be parsed into a nicer
> format than used now.

  Great stuff, I really really like your solution to the parsing problem. 
The patch is now applied, with a couple changes:

  * MessageSet.__iadd__ was renamed to MessageSet.extend.  __iadd__ gives me

  * I re-arranged the MessageSet.last property code in a trivial manner to
keep the class namespace cleaner.  As a result, _getLast and _setLast are no
longer available explicitly, only implicitly through reads and writes of the

  I am unsure about the usefulness of the LiteralString class in its current
state.  It seems to open up the possiblity of an unbounded memory usage
attack against the server.  I'm considering either removing it and using
LiteralFile in its place, or adding a limit to the size of string it will
accept (something on the order of a kilobyte or two, though I will check
exactly what might get passed to it by a benign client before picking a
default limit).  Do you have any particular reason to want to keep it, or to
keep it unlimited?

  I suppose I will be thinking about how to apply a similar change to the
client code, where it will have (at least to me ;) a much more noticable
affect on performance.  It seems a little tougher, but maybe a mapping of
responses to parsers would do the job...  Any ideas in this area would be
welcome :)

  Thanks again for this contribution,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030703/be7ed160/attachment.pgp 

More information about the Twisted-Python mailing list