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
Unknown Object (File)
Oct 14 2024, 12:09 PM
Unknown Object (File)
Oct 11 2024, 6:32 AM
Unknown Object (File)
Oct 10 2024, 7:52 AM
Unknown Object (File)
Oct 5 2024, 11:03 AM
Unknown Object (File)
Oct 5 2024, 4:27 AM
Unknown Object (File)
Oct 5 2024, 1:40 AM
Unknown Object (File)
Oct 2 2024, 1:18 PM
Unknown Object (File)
Oct 1 2024, 10:08 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).