Page MenuHomePhabricator

Provide a streaming HTTP response parser
ClosedPublic

Authored by epriestley on Feb 7 2018, 12:14 AM.
Tags
None
Referenced Files
F19017443: D19011.diff
Nov 23 2025, 7:55 AM
F18873974: D19011.id.diff
Nov 5 2025, 12:27 PM
F18871200: D19011.diff
Nov 4 2025, 9:36 PM
F18842758: D19011.diff
Oct 28 2025, 6:17 PM
F18831497: D19011.id45580.diff
Oct 25 2025, 1:26 PM
F18756696: D19011.id.diff
Oct 5 2025, 12:49 PM
F18754568: D19011.diff
Oct 4 2025, 11:33 PM
F18754155: D19011.diff
Oct 4 2025, 9:32 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable