Page MenuHomeFreeBSD

libfetch: Overhaul socket read / write
ClosedPublic

Authored by des on Sat, Jun 27, 2:30 PM.
Tags
None
Referenced Files
F162914652: D57906.id.diff
Sat, Jul 18, 6:35 AM
F162907232: D57906.id181878.diff
Sat, Jul 18, 4:49 AM
Unknown Object (File)
Sat, Jul 18, 1:53 AM
Unknown Object (File)
Wed, Jul 15, 1:45 AM
Unknown Object (File)
Mon, Jul 13, 11:42 AM
Unknown Object (File)
Sun, Jul 12, 4:02 AM
Unknown Object (File)
Sat, Jul 11, 2:51 PM
Unknown Object (File)
Tue, Jul 7, 2:59 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 74330
Build 71213: arc lint + arc unit

Event Timeline

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