Re: half-closed connections?

From: Adrian Chadd <adrian@dont-contact.us>
Date: Fri, 20 Feb 2004 05:24:36 -0700

On Fri, Feb 20, 2004, Henrik Nordstrom wrote:
> On Fri, 20 Feb 2004, Adrian Chadd wrote:
>
> > Is there actually a valid reason for squid to even support
> > half-closed connections any more?
>
> Personally I don't beleive in half-closed connections in HTTP, but some
> people like to be able to do things like
>
> (echo "GET http://www.squid-cache.org HTTP/1.0"; echo) | telnet
> proxyserver 3128

Hm.

> > It just seems like an utter pain in the butt to support correctly..
> > I'm trying to track down a bug in the FTP paths relating to
> > incorrect half-closed handling..
>
> In what sense does the FTP path care about half-closed? Any actions seen
> by the FTP module should be independent on if half-closed connections is
> allowed or not, only the sizes of various race windows should change.
> Please elaborate.

* i start mirroring something via lftp
* lftp uses Keepalive in its HTTP requests
* I hit ctrl-C in lftp
* a client fd does this:
  - read handler gets called, size 0
  - commMarkHalfClosed() is called
  - ... no more IO is scheduled
  - write handler gets called, sucessful write
  - since Keepalive, the next request is scheduled
  - .. so, a comm_read is issued ..
  - .. which schedules a read ..
  - read returns size 0 since yes, the socket has gone away
  - commMarkHalfClosed() is called
  - but, since the socket is already marked as half-closed, we get an assert and
    it all goes pear shaped

Now, my questions:

* in ConnStateData::readSomeData(), is it ok to just return if the socket
  is marked as half closed? Will a half-closed socket ever be re-opened
  somehow?
* what is the whole point of AbortChecker? As far as I can tell
  AbortChecker::doIOLoop() isn't being called at all. I've modified it
  to actually be called once a second, with no ill effects.

I can post a diff with what I've got thus far. quite a bit of stuff has
been refactored and I don't pray to understand it all.

Adrian
Received on Fri Feb 20 2004 - 05:24:37 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:04 MST