On 11/18/2011 03:52 PM, Amos Jeffries wrote:
>>> The edge case is likely to be
>>> ClientSocketContext::keepaliveNextRequest() where pinning closes the
>>> conn. That is one error case and could potentially lead to problems. I
>>> suspect that it should be doing stopSending("pinned server gone") before
>>> it does comm_close(). Do you agree?>> I am afraid no. There is no point in calling stopSending (or >> stopReceiving) before calling comm_close() because comm_close() will >> kill the connection and we would have to stop sending and receiving. > I was thinking more along the lines of passing the reason for closure. > Its not causing any bad behaviour that I can see. I agree that closing reason is often valuable, but I do not think we should abuse stopSending() that way. We can add the closing reason to fd_table (passed via an optional comm_close parameter), reuse fd_note API to record/store it, or add a third ConnStateData data member. Recording connection closing reason would be outside this fix scope though. Thank you, Alex.
