-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to get streaming read sizes to match up with chunk sizes where
possible. The IODebug logging for these two cases now has less `unread!`-ing and less fragmentation. ``` HTTP.open(..., verbose=3) do http while !eof(http) buf = Vector{UInt8}(undef, 4096) @show readbytes!(http, buf) end end HTTP.open(..., verbose=3) do http while !eof(http) readavailable(http) end end ``` Add readuntil_block_size = 4096. Attempt to avoid reading ahead to far when looking for end of headers / endof chunksize. Speculatively try to read and ignore 2 extra bytes in chunked mode. Usually the trailing CRLF seems to be in the same packet as the last part of the chunk data, so this avoids a follow-up fragmented read when parsing the next chunk size. This should have no downside for peers that send the trailing CRLF in the same packet as the new chunk size as the chunk size parser will still ignore it in that case.
- Loading branch information
1 parent
3cbd5d1
commit 6414e99
Showing
2 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters