Correctly handle invalidated POST data on upload path
DecodeRfc1867 was returning a data and length pointer that were being copied and saved for use with php://input. In the case where AlwaysPopulateRawPostData is false, data will actually point to the last chunk received, but size will be the cumulative size of the post. There's nothing meaningful that can be done with this data, just ignore it.
The data copy immediately prior to DecodeRfc1867 was unecessary when AlwaysPopulate was off, but for a silly realloc call in read_post. Reworked this case to avoid the realloc/memcpy and just read directly from the network buffer. While I was there, I corrected some integer types that could cause problems for POSTs > 2GB.
Reviewed By: @ptarjan
Differential Revision:
D1164497