Mailing List Archive

Proxying HTTP - end of message?
Hi,

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).

Thanks,
Andrew


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Proxying HTTP - end of message? [ In reply to ]
http://www.cyberclip.com/webdebug/

--
--Darrell
Andrew Cooke <andrew@andrewcooke.free-online.co.uk> wrote in message
news:7kgkbk$uso$1@nnrp1.deja.com...
>
>
> Hi,
>
> 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).
>
> Thanks,
> Andrew
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Proxying HTTP - end of message? [ In reply to ]
Are you using Connection: close and friends? Your browser may be setting up
a persistant connection...


----- Original Message -----
From: Andrew Cooke <andrew@andrewcooke.free-online.co.uk>
Newsgroups: comp.lang.python
To: <python-list@cwi.nl>
Sent: Sunday, June 20, 1999 3:34
Subject: Proxying HTTP - end of message?


>
>
> Hi,
>
> 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).
>
> Thanks,
> Andrew
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
>