On 07/04/07, Clark C. Evans <[EMAIL PROTECTED]> wrote: > On Fri, Apr 06, 2007 at 12:08:17PM +1000, Graham Dumpleton wrote: > | FWIW, in mod_wsgi I have now added a directive which allows one to > | enable within a specific context that chunked transfer encoding should > | be used for a response when a HTTP/1.1 client is being used. > > That's great ;) > > | At this stage is probably better than nothing given that WSGI doesn't > | provide a way of enabling it. > > In your implementation, how would I indicate where the chunk boundaries > should be? Or is this just a fixed size thing?
In respect of requirements in WSGI specification for flushing blocks of data, mod_wsgi implements: """1. Send the entire block to the operating system (and request that any O/S buffers be flushed) before returning control to the application,""" In Apache, each time a flush is performed it will send all buffered data as a chunk. Thus, if you are using a generator as the iterable, a flush is performed after each block of data your application returns and so each block of data you yield becomes a chunk. Even were you to return a sequence as the iterable, a flush is performed after outputing each block in the sequence and thus each block in a sequence also becomes a chunk. Graham _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com