Page MenuHomeFreeBSD

libfetch: Overhaul socket read / write
ClosedPublic

Authored by des on Jun 27 2026, 2:30 PM.
Tags
None
Referenced Files
F168986553: D57906.id181878.diff
Mon, Aug 31, 1:41 AM
F168953093: D57906.id180928.diff
Sun, Aug 30, 10:39 PM
F168948036: D57906.id180819.diff
Sun, Aug 30, 10:04 PM
F168942306: D57906.id180822.diff
Sun, Aug 30, 9:14 PM
F168930261: D57906.id180817.diff
Sun, Aug 30, 7:42 PM
Unknown Object (File)
Sat, Aug 29, 12:54 AM
Unknown Object (File)
Thu, Aug 27, 3:55 PM
Unknown Object (File)
Wed, Aug 26, 8:44 PM
Subscribers

Details

Summary
  • Make fetch_ssl_read() and fetch_ssl_write() behave more like read(2) and write(2), and drop fetch_socket_read() in favor of read(2).
  • Don't request POLLERR, it's implied.
  • Don't needlessly set errno, it's relatively costly.
  • Always check for EAGAIN from writev(2), otherwise we will abort on a short write instead of proceeding to poll(2).
  • Always check for EAGAIN from poll(2) even though it can't happen on FreeBSD; POSIX says it can, and it might in the future.
  • Rewrite fetch_read() and fetch_writev() to be more similar to each other. The main difference is that a partial read is treated as success while a partial write is treated as failure.

PR: 296316
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Jun 27 2026, 2:30 PM
des edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 8 2026, 10:49 AM
This revision was automatically updated to reflect the committed changes.