Re: [PATCH] sendfile erroniously returns ENOTCONN.

2004-01-03 Thread Alfred Perlstein
* David G. Lawrence [EMAIL PROTECTED] [040103 00:55] wrote: * David G. Lawrence [EMAIL PROTECTED] [040102 21:41] wrote: sendfile(8) tries to maintain compatibility with sosend as much as is reasonable. ENOTCONN is the appropriate error to return if the socket isn't connected.

Re: [PATCH] sendfile erroniously returns ENOTCONN.

2004-01-03 Thread David G. Lawrence
sendfile(2) returns ENOTCONN when the remote side has disconnected instead of EPIPE. Can this fix be applied? Is there a reason for it being the way it is? I know EPIPE can cause SIGPIPE which can cause problems, but the error here is incorrect, and considering that the manpage mentions

Re: [PATCH] sendfile erroniously returns ENOTCONN.

2004-01-03 Thread David G. Lawrence
* David G. Lawrence [EMAIL PROTECTED] [040102 21:41] wrote: sendfile(8) tries to maintain compatibility with sosend as much as is reasonable. ENOTCONN is the appropriate error to return if the socket isn't connected. sosend checks SS_CANTSENDMORE prior to the check for

Re: [PATCH] sendfile erroniously returns ENOTCONN.

2004-01-03 Thread David G. Lawrence
Yes, I think checking for SS_CATSENDMORE (and returning EPIPE) prior to checking SS_ISCONNECTED (and returning ENOTCONN as it does now) is the right thing to do. Last question (I hope)... :) Why not call sosend? sosend is the primary mechanism that write(8) uses to send data on

[PATCH] sendfile erroniously returns ENOTCONN.

2004-01-02 Thread Alfred Perlstein
sendfile(2) returns ENOTCONN when the remote side has disconnected instead of EPIPE. Can this fix be applied? Is there a reason for it being the way it is? I know EPIPE can cause SIGPIPE which can cause problems, but the error here is incorrect, and considering that the manpage mentions EPIPE

Re: [PATCH] sendfile erroniously returns ENOTCONN.

2004-01-02 Thread Alfred Perlstein
* David G. Lawrence [EMAIL PROTECTED] [040102 21:41] wrote: sendfile(8) tries to maintain compatibility with sosend as much as is reasonable. ENOTCONN is the appropriate error to return if the socket isn't connected. sosend checks SS_CANTSENDMORE prior to the check for SS_ISCONNECTED,