When returning EV_EOF for the socket read/write filters, also return
the current socket error in fflags. This may be useful for determining why a connect() request fails. Inspired by: "Jonathan Graehl" <jonathan@graehl.org>
This commit is contained in:
parent
f44ba58cab
commit
b07540c837
@ -1582,6 +1582,7 @@ filt_soread(struct knote *kn, long hint)
|
||||
kn->kn_data = so->so_rcv.sb_cc;
|
||||
if (so->so_state & SS_CANTRCVMORE) {
|
||||
kn->kn_flags |= EV_EOF;
|
||||
kn->kn_fflags = so->so_error;
|
||||
return (1);
|
||||
}
|
||||
if (so->so_error) /* temporary udp error */
|
||||
@ -1610,6 +1611,7 @@ filt_sowrite(struct knote *kn, long hint)
|
||||
kn->kn_data = sbspace(&so->so_snd);
|
||||
if (so->so_state & SS_CANTSENDMORE) {
|
||||
kn->kn_flags |= EV_EOF;
|
||||
kn->kn_fflags = so->so_error;
|
||||
return (1);
|
||||
}
|
||||
if (so->so_error) /* temporary udp error */
|
||||
|
Loading…
Reference in New Issue
Block a user