Proxying HTTP - end of message?

Andrew Cooke andrew at
Sat Jun 19 13:34:44 EDT 1999


I'm writing a small http proxy (I know a million already exist -
my program isn't important, understanding the bug is).  I have a
couple of threads, spinning away, one copying from client to server
and one from server to client.  When there is no more data to read
from the server the blocking read returns None and I close both
sockets (one socket is proxy-client, the other proxy-server).

But my browser continues to wait.  If I press "stop" I have all the
page, but the browser thinks the download has been interrupted.

What am I missing?  It appears as though the browser isn't detecting
that the connection has been closed - why not?

For what it's worth, this is on NT, I'm extending SocketServer, and
using 1.5.2.  But I suspect this is a problem with my logic rather
than any piece of software....

Any sugegstions appreciated (I can post/forward code - it's my own
work, not my employer's).


Sent via
Share what you know. Learn what you don't.

More information about the Python-list mailing list