Page MenuHomePhabricator

Provide a streaming HTTP response parser
ClosedPublic

Authored by epriestley on Feb 7 2018, 12:14 AM.
Tags
None
Referenced Files
F15477673: D19011.id45798.diff
Mon, Apr 7, 5:17 PM
F15459747: D19011.diff
Mon, Mar 31, 3:47 PM
F15443109: D19011.id45798.diff
Thu, Mar 27, 2:27 AM
F15442860: D19011.id.diff
Thu, Mar 27, 12:54 AM
F15441005: D19011.id45580.diff
Mar 26 2025, 4:03 PM
F15436430: D19011.id.diff
Mar 25 2025, 2:04 PM
F15433523: D19011.diff
Mar 24 2025, 11:38 PM
F15420053: D19011.id45798.diff
Mar 21 2025, 10:55 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable