David Schwartz wrote:
Nanno Langstraat wrote:
   * Our TCP proxy gets read()==0 on the TCP socket.

   * In response, our proxy does shutdown(WR) on the local drain file
     descriptor (the other side of the proxy).
     This propagates the "read()==0" event to the local endpoint
     process that we're being a proxy for.
Why are you doing a shutdown(WR) in response to a read()=0 ?  Euh!

Since you can no longer read form one end, you can no longer write to the
other, assuming you have no data buffered.

No.  read()=0 means the shutdown(WR) was performed on the remote end!

This means as we have read end-of-stream condition at the local end, we may issue a shutdown(RD).



If you know you have an end-of-stream condition in the read side of your
socket and then you issue a shutdown(WR) the only remaining action after
this is to close().

Did you miss the "on the local drain file descriptor" part?

What is there to drain when you already saw the read()=0. This means there is nothing to drain on the receive side. You will not see read()=0 is there is still receive data to drain.

From the send side perspective you can not issue the shutdown(WR) until you have make the decision there is nothing else to write to the socket. The comment above already states that action is taken (so the decision has been made).

This makes the rest of what happens after irrelevant, the only action from now is close().


Darryl
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to