Page MenuHomeFreeBSD

Check for SS_NBIO in so->so_state instead of sb->sb_flags.
ClosedPublic

Authored by jhb on Dec 12 2014, 4:16 PM.
Tags
None
Referenced Files
F169388551: D1299.id2719.diff
Tue, Sep 1, 9:43 AM
F169169073: D1299.id2750.diff
Mon, Aug 31, 4:21 PM
Unknown Object (File)
Mon, Aug 31, 9:21 AM
Unknown Object (File)
Mon, Aug 31, 4:12 AM
Unknown Object (File)
Sun, Aug 30, 7:53 PM
Unknown Object (File)
Sat, Aug 29, 2:49 PM
Unknown Object (File)
Sat, Aug 29, 9:16 AM
Unknown Object (File)
Sat, Aug 29, 4:22 AM
Subscribers

Details

Summary

I noticed this while code reading. I think the only case it would affect
is if you called read() on a non-blocking socket where 0 < sb_cc < sb_lowat
(and the buffer size (uio_resid) was > sb_cc). In that case, you would
block in sbwait() instead of returning a short read.

Test Plan

I have not yet written a test case for this. It would perhaps not be hard
to use TCP_NODELAY on the sender to send 1 byte after the receiver has
raised sb_lowat to 2.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jhb retitled this revision from to Check for SS_NBIO in so->so_state instead of sb->sb_flags..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
bz added a reviewer: bz.
bz added a subscriber: bz.

Seems correct to me. It's only been like that since 2009 ;-(

This revision is now accepted and ready to land.Dec 12 2014, 5:11 PM
gnn added a reviewer: gnn.
gnn added a subscriber: gnn.

Nice catch.

jhb updated this revision to Diff 2750.

Closed by commit rS275808 (authored by @jhb).