[Twisted-Python] Large Transfers

Bernhard Herzog bh at intevation.de
Sat May 10 13:50:54 EDT 2003

Andrew Bennetts <andrew-twisted at puzzling.org> writes:

> On Sat, May 10, 2003 at 06:01:40PM +0200, Bernhard Herzog wrote:
> > 
> > The tests, AFAICT, simply check the length (as defined by the len
> > builtin) of lists, tuples and strings. So if the sender can't send e.g.
> > [0] * 1000000, it could just as well send [[0] * 1000 for i in range(1000)]
> > which would consume roughly the same amount of memory on the receiver's
> > side but would pass all the SIZE_LIMT tests. Using a large dictionary
> > seems to work too.
> > 
> > A better solution for limiting the size seems to be a limit on the
> > number of bytes accepted by the receiver for a single PB call.
> You seem to be misunderstanding the difference between PB and Banana.

While I wouldn't claim to understand all of it, I am aware that PB !=
Banana. But PB uses Banana AFAIK, so any limit in Banana is also a limit
in PB.

>  The limit is in the Banana layer, so that it can remain simple and
> fast.

But why hardwire it?

> A long list of small items breaks into small pieces at the Banana
> level already.

I'm not sure what's this supposed to mean. If I try to send [0] * 1000000
via PB I do get an error because of the size limit, while
[[0] * 1000 for i in range(1000)] works (at least with the Python
implementation, I didn't try cBanana). Is one of them handled completely
at the banana-level and the other isn't?


Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/

More information about the Twisted-Python mailing list