IStreamIterator can't use chunking

Bug #143581 reported by Paul Winkler
2
Affects Status Importance Assigned to Milestone
Zope 2
Opinion
Wishlist
Unassigned

Bug Description

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.

Tags: feature zope
Changed in zope2:
importance: Low → Wishlist
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.