Page MenuHomePhabricator

Provide a streaming HTTP response parser
ClosedPublic

Authored by epriestley on Feb 7 2018, 12:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 31, 11:31 PM
Unknown Object (File)
Thu, May 29, 2:11 PM
Unknown Object (File)
Wed, May 28, 1:07 PM
Unknown Object (File)
Tue, May 27, 10:22 PM
Unknown Object (File)
Mon, May 19, 9:29 PM
Unknown Object (File)
May 5 2025, 11:26 AM
Unknown Object (File)
Apr 28 2025, 1:20 AM
Unknown Object (File)
Apr 7 2025, 5:17 PM
Subscribers
None

Details

Summary

Ref T12907. The major blocker to doing a shard rebalance/migration in the cluster is that we can't download files which are larger than 2GB via native stuff, since the entire response is held in memory.

We could just make the thing shell out to wget, but this limitation affects other things like arc download so it would be nice to fix it properly.

I'd like to replace the "hold the whole thing in memory" parser with a streaming parser, and then let the streaming parser stream the response bodies to disk.

To this end, provide a streaming parser with some tests. These aren't exhaustive, but should at least cover the basics fairly well.

This doesn't actually do anything yet.

Test Plan

Ran tests.

Diff Detail

Repository
rPHU libphutil
Branch
disk1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 19374
Build 26198: Run Core Tests
Build 26197: arc lint + arc unit