Opened 14 years ago

Closed 14 years ago

#1755 defect closed fixed (fixed)

t.w2.twscgi.SCGIClientProtocol causes an exception to be raised in t.w2.log._LogByteCounter

Reported by: David Reid Owned by:
Priority: high Milestone:
Component: web2 Keywords:
Cc: Branch:
Author:

Description

t.w2.twscgi.SCGIClientProtocol assumes that the http.Response object will not be mutated after it is returned. This is not a valid assumption the response may be mutated by other systems such as t.w2.log. SCGIClientProtocol, should instead keep a direct reference to the stream it returns in the outgoing response and write to that, as the response.stream is changed by t.w2.log for the purposes of byte counting.

This bug brought to you by the letter A.

Change History (11)

comment:1 Changed 14 years ago by David Reid

Priority: normalhigh
Type: enhancementdefect

comment:2 Changed 14 years ago by David Reid

Status: newassigned

comment:3 Changed 14 years ago by David Reid

branched to source:branches/twscgi-stream-fix-1755

comment:4 Changed 14 years ago by David Reid

Keywords: review added

comment:5 Changed 14 years ago by David Reid

Owner: changed from David Reid to Stephen Thorne
Status: assignednew

comment:6 Changed 14 years ago by David Reid

Owner: changed from Stephen Thorne to David Reid

[20060607T150006]< Jerub> dreid: my comments were something like, "comment on why self.response is set to

None but self.stream isn't" and merge.

comment:7 Changed 14 years ago by David Reid

Resolution: fixed
Status: newclosed

(In [17135]) Make twscgi not rely on self.response not being mutated after it is returned. In certain situations such as logging the response is mutated to wrap the stream object, this causes an issue with doing self.response.stream.write("Foo") after you have returned self.response because self.response.stream is not the object you thought it was.

Author: dreid Reviewer: Jerub Fixes #1755

comment:8 Changed 14 years ago by Jean-Paul Calderone

Resolution: fixed
Status: closedreopened

Reverted at r17135 - the branch uses Python 2.4 syntax, but Python 2.3 is a supported platform.

comment:9 Changed 14 years ago by Stephen Thorne

Keywords: review removed
Status: reopenednew

Nasty bug. Thanks exarkun for that revert. Please merge now dreid.

comment:10 Changed 14 years ago by David Reid

Resolution: fixed
Status: newclosed

(In [17142]) Fix twscgi to write to the stream directly instead of to the stream on the response object it has returned.

Author: dreid Reviewer: Jerub Fixes #1755

comment:11 Changed 9 years ago by <automation>

Owner: David Reid deleted
Note: See TracTickets for help on using tickets.