[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-dev
Subject:    Re: concurrent requests?
From:       Henrik Nordstrom <hno () hem ! passagen ! se>
Date:       2000-05-31 21:32:07
Message-ID: 393584D7.12749BE0 () hem ! passagen ! se
[Download RAW message or body]

Adrian Chadd wrote:

> I drew some of this out on paper after I sent my last mail. To detect
> half-closed connections you read the FD and if EOF under certain
> conditions you want. You can't poll the fd since the FD will always
> return read ready. .. so yu need to do a read() and handle the
> return. What I was thinking about is to 'inject' data into a comm_read().
> That would be a neat solution. Got any other suggestions ?

You only need to detect this once. Then it is a known fact. You cannot
receive any more from that socket.

My suggesting is to simply have comm_read return EOF and then be done
with it. After that no further comm_read should be issued on that
filedescriptor, and should return EOF if attempted. comm_read should
never mark a EOF state filedescriptor for select.

For a binady data stream EOF is usually indicated by zero bytes of data
returned.

write will tell you if there are any error sending data out on the
socket, and getsockopt(..SO_ERROR) can be used to periodically poll the
socket for errors when there is no activity. Polling for an error only
useful if keep-alives are enabled or the client properly sends RESET
when aborting the connection (ABORT TCP operation, defined in Internet
Standard 6 but not covered in the "standard" sockets API).

/Henrik

[Attachment #3 (message/rfc822)]

This is a MIME-encapsulated message

The original message was received at Wed, 31 May 2000 19:57:34 +0200 (CEST)
from root@localhost

   ----- The following addresses had permanent fatal errors -----
squid-dev@squid-cche.org

   ----- Transcript of session follows -----
550 squid-dev@squid-cche.org... Host unknown (Name server: squid-cche.org: host not found)

[Attachment #6 (message/delivery-status)]

Reporting-MTA: dns; octo.memory.se
Arrival-Date: Wed, 31 May 2000 19:57:34 +0200 (CEST)

Final-Recipient: rfc822; squid-dev@squid-cche.org
Action: failed
Status: 5.1.2
Remote-MTA: dns; squid-cche.org
Last-Attempt-Date: Wed, 31 May 2000 19:58:56 +0200 (CEST)


Received: from [193.13.248.117] by octo.memory.se
	for squid-dev@squid-cche.org
	id TAA08478; Wed May 31 19:57:35 2000
Received: from henrik.localdomain (localhost [127.0.0.1])
	by henrik.localdomain (8.9.3/8.9.3) with SMTP id TAA22662;
	Wed, 31 May 2000 19:57:09 +0200
Message-ID: <39355275.6DBDBC9E@hem.passagen.se>
Date: Wed, 31 May 2000 19:57:09 +0200
X-Mailer: Mozilla 3.01 (X11; I; Linux 2.2.13-reiserfs i586)
MIME-Version: 1.0
Subject: Re: concurrent requests?
References: <20000531203025.J21985@ewok.creative.net.au> \
<39350E15.5E3B845C@hem.passagen.se> <20000531214244.N21985@ewok.creative.net.au> \
<393520CA.34870BCC@hem.passagen.se> <20000531224956.Q21985@ewok.creative.net.au> \
                <39354590.728CB124@hem.passagen.se> \
                <20000601012323.R21985@ewok.creative.net.au>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Adrian Chadd <adrian@creative.net.au>
From: Henrik Nordstrom <hno@hem.passagen.se>
Sender: hno@hem.passagen.se
Cc: squid-dev@squid-cche.org

Adrian Chadd wrote:

> I drew some of this out on paper after I sent my last mail. To detect
> half-closed connections you read the FD and if EOF under certain
> conditions you want. You can't poll the fd since the FD will always
> return read ready. .. so yu need to do a read() and handle the
> return. What I was thinking about is to 'inject' data into a comm_read().
> That would be a neat solution. Got any other suggestions ?

You only need to detect this once. Then it is a known fact. You cannot
receive any more from that socket.

My suggesting is to simply have comm_read return EOF and then be done
with it. After that no further comm_read should be issued on that
filedescriptor, and should return EOF if attempted. comm_read should
never mark a EOF state filedescriptor for select.

For a binady data stream EOF is usually indicated by zero bytes of data
returned.

write will tell you if there are any error sending data out on the
socket, and getsockopt(..SO_ERROR) can be used to periodically poll the
socket for errors when there is no activity. Polling for an error only
useful if keep-alives are enabled or the client properly sends RESET
when aborting the connection (ABORT TCP operation, defined in Internet
Standard 6 but not covered in the "standard" sockets API).

/Henrik



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic