[ZCM] [ZC] 1962/ 1 Request "IStreamIterator can't use chunking"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Dec 5 14:20:41 EST 2005


Issue #1962 Update (Request) "IStreamIterator can't use chunking"
 Status Pending, Zope/feature low
To followup, visit:
  http://www.zope.org/Collectors/Zope/1962

==============================================================
= Request - Entry #1 by slinkp on Dec 5, 2005 2:20 pm

In order to get ZServer to use http 1.1 chunking, these conditions must be met:

 1. A Content-Length header must not be set.
 2. The request must be HTTP 1.1
 3. You must be streaming (i.e. RESPONSE._streaming must be true)
 4. No 'Connection: close' header has been set during the request

It would be nice to be able to create an implementation of IStreamIterator() that used chunking, if e.g. you can't know ahead of time the size of data that you will return.  But ZServerHTTPResponse.setBody() currently enforces that content-length is set when you provide an IStreamIterator, so you can't do that.

I *think* this could be fixed with some simple changes to setBody(); just check conditions 1,2, and 4 above, and if they are met, set self._streaming true and use the iterator; otherwise fall back to the current behavior.

But I don't have an urgent need for this, and we can just use response.write() instead, so I'm not planning to work on it anytime soon; but I thought I'd better put this in the collector before I forget about it entirely.

==============================================================



More information about the Zope-Collector-Monitor mailing list