Page MenuHomeFreeBSD

libfetch: Add read buffering
Needs ReviewPublic

Authored by des on Sat, Jun 27, 2:30 PM.
Tags
None
Referenced Files
F160917619: D57907.diff
Mon, Jun 29, 1:09 AM
Unknown Object (File)
Sun, Jun 28, 9:41 AM
Subscribers

Details

Reviewers
bapt
Summary

Previously, we would read FTP control connection messages and HTTP
reponse headers one character at a time. Now, we read as much as will
fit in our buffer and look for a newline. If there is data left over,
it will be reused by the next fetch_getln() call. This also requires
the addition of a fetch_bufread() which takes the buffer into account,
otherwise the start of the HTTP response body will be stuck in the
buffer after we read the last line of the header.

This should noticeably improve HTTP performance, especially for small
transfers.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74390
Build 71273: arc lint + arc unit