Hi,

Whenever you look into this, I noticed that a streamed upload also fails, but 
differently;

cat <large file> | acurl https://rnewson.cloudant.com/db1/doc1/att1 -XPUT -T-

curl chooses http/2 and sends the Transfer-Encoding: chunked header, and then 
streams the file.

The result is that the body is not received, the resulting upload is zero bytes.

I mention this for completeness but it would seem curl is at fault here, it 
should not send the Transfer-Encoding header, but I'm not sure haproxy is 
entirely innocent either?

B.

* acurl is simple a curl alias that adds my user:pass credentials.

> On 1 Mar 2018, at 11:06, Willy Tarreau <w...@1wt.eu> wrote:
> 
> On Thu, Mar 01, 2018 at 09:38:10AM +0000, Robert Samuel Newson wrote:
>> Yup, agreed, the frame-only transfers are only really implied in the spec
>> (8.1.2.6's, "A request or response that includes a payload body _can_ include
>> a content-length header field", my emphasis). The http 2 spec does
>> specifically prohibit the transfer-encoding: chunked header, again implying
>> that the framing mechanism subsumes it.
> 
> In fact it's even worse for me : I identified I had to do it, as indicated
> by the comments on top of function h2_frt_transfer_data() which claim that
> when no C-L nor tunnel is found, chunks are emitted. But apparently relying
> too much on the checks I had on the paper-written RFC allowed me to completely
> forget about this part! I've checked if I had a temporary implementation in
> one of my previous dev branches but no, so I think I never wrote that code.
> The good point is that the code was written with this in mind, so I hope I
> won't face too big a surprise (and none of the usual "ah now I remember why").
> 
>> There are a few libraries (like https://github.com/go-kivik/couchdb) which
>> implement PUT without sending Content-Length, but other tools, like good old
>> curl, which do send it.
> 
> Good to know, thanks for the links. Indeed, curl always used C-L.
> 
>> The basic plan to transform to a chunked transfer encoding sounds right to
>> me, and I'll keep an eye out for commits, I'm happy to test it out.
> 
> Thanks!
> Willy


Reply via email to