On Tuesday, September 30, 2003, at 04:23 PM, Peter Schuller wrote:
>> for details) when the client closes the tcp connection prematurely,
>> python process/thread runniung the servlet starts looping with 100%
> Ok, I have confirmed that the problem occurrs with mod_webkit aswell.
> Also, I have been trying to understand what might be going on. But I
> for the life of me find the location in the code where the data
> actually gets
> sent to the client.
> HTTPResponse.write() does write the data to _strmOut, but that is a
> TASASStreamOut according to the debug output I put in before the
> write(). The
> TASASStreamOut class only puts data in an in-memory buffer (even when
> flushing) and I cannot locate where that data is actually pulled out
> of the
> stream and sent to the socket.
> In either case, it is clear that
> def createResponseInTransaction(self, transaction, strmOut):
> response = self._responseClass(transaction, strmOut)
> return response
> of Application is giving the actual socket (strmOut) to the response
> which I assume is HTTPResponse (though I can't find it). The
> constructor of
> HTTPResponse passes strmOut to the parent - Response - which sets the
> _strmOut instance variable. So it looks to me that
> should be the socket, yet when I attempt to verify that I get a
> TASASStramOut, and I have no clue where it came from.
No, strmOut is TASASStreamOut -- that object is created by
ThreadedAppServer, and Application never sees the raw socket object.
TASASStreamOut does send data on the socket, though only if you do
The problem might be in TASASStreamOut.flush:
sent = sent + self._socket.send(self._buffer[sent:sent+8192])
except socket.error, e:
if e==errno.EPIPE: #broken pipe
print "StreamOut Error: ", e
This error handling is sub-optimal, to say the least.