You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Michael Osipov <mi...@apache.org> on 2020/05/03 23:07:20 UTC
Expect continue on chunked TE
Folks,
why does RequestExpectContinue require entity.getContentLength() != 0?
5.1.1. Expect does not require a content length to be set. It only
requires a request body. What if the request body is sent in chunks?
Am I wrong here?
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: Expect continue on chunked TE
Posted by Michael Osipov <mi...@apache.org>.
Am 2020-05-04 um 14:04 schrieb Oleg Kalnichevski:
> On Mon, 2020-05-04 at 12:29 +0200, Michael Osipov wrote:
>> Am 2020-05-04 um 11:22 schrieb Oleg Kalnichevski:
>>> On Mon, 2020-05-04 at 01:07 +0200, Michael Osipov wrote:
>>>> Folks,
>>>>
>>>> why does RequestExpectContinue require entity.getContentLength()
>>>> !=
>>>> 0?
>>>> 5.1.1. Expect does not require a content length to be set. It
>>>> only
>>>> requires a request body. What if the request body is sent in
>>>> chunks?
>>>>
>>>
>>> In that case the entity#getContentLength() call would return -1 and
>>> the
>>> test would fail.
>>
>> Is this simply because of the test like that? Let's abstract from
>> the
>> test the content could be created on the fly. This wouldn't be
>> coverted
>> at all. WDYT?
>>
>
> Why not? When content is generated on the fly and its length is not
> known the entity#getContentLength() call is expected to return -1.
>
> The test -1 != 0 would resolve to true if other conditions are met
> would trigger `expect-continue` handshake.
Embarassing! I completely forgot that chunked will have -1 set while
zero has to be set explicitly. Thanks for the heads up!
M
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: Expect continue on chunked TE
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2020-05-04 at 12:29 +0200, Michael Osipov wrote:
> Am 2020-05-04 um 11:22 schrieb Oleg Kalnichevski:
> > On Mon, 2020-05-04 at 01:07 +0200, Michael Osipov wrote:
> > > Folks,
> > >
> > > why does RequestExpectContinue require entity.getContentLength()
> > > !=
> > > 0?
> > > 5.1.1. Expect does not require a content length to be set. It
> > > only
> > > requires a request body. What if the request body is sent in
> > > chunks?
> > >
> >
> > In that case the entity#getContentLength() call would return -1 and
> > the
> > test would fail.
>
> Is this simply because of the test like that? Let's abstract from
> the
> test the content could be created on the fly. This wouldn't be
> coverted
> at all. WDYT?
>
Why not? When content is generated on the fly and its length is not
known the entity#getContentLength() call is expected to return -1.
The test -1 != 0 would resolve to true if other conditions are met
would trigger `expect-continue` handshake.
Oleg
> M
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: Expect continue on chunked TE
Posted by Michael Osipov <mi...@apache.org>.
Am 2020-05-04 um 11:22 schrieb Oleg Kalnichevski:
> On Mon, 2020-05-04 at 01:07 +0200, Michael Osipov wrote:
>> Folks,
>>
>> why does RequestExpectContinue require entity.getContentLength() !=
>> 0?
>> 5.1.1. Expect does not require a content length to be set. It only
>> requires a request body. What if the request body is sent in chunks?
>>
>
> In that case the entity#getContentLength() call would return -1 and the
> test would fail.
Is this simply because of the test like that? Let's abstract from the
test the content could be created on the fly. This wouldn't be coverted
at all. WDYT?
M
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: Expect continue on chunked TE
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2020-05-04 at 01:07 +0200, Michael Osipov wrote:
> Folks,
>
> why does RequestExpectContinue require entity.getContentLength() !=
> 0?
> 5.1.1. Expect does not require a content length to be set. It only
> requires a request body. What if the request body is sent in chunks?
>
In that case the entity#getContentLength() call would return -1 and the
test would fail.
Oleg
> Am I wrong here?
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org