cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: http/2 multiple post requests

From: Scott Mitchell <scott.k.mitch1_at_gmail.com>
Date: Fri, 10 Oct 2014 09:30:36 -0400

>
>
> But why is it -1 there? That would indicate that there was no :status
> header? At least that's what the code assumes and why it tries to reset the
> stream there.
>
>
Great question. My server did not have the ":status" header first in all
situations. This has been corrected now and curl is working great in the
happy path.

I'm not sure either because I've not seen the code flow of this problem.
> status_code is meant to be -1 until the proper one is found in the :status
> header. And since :status is the first header, finding another header with
> status_code set to -1 signifies an error!
>
>
Agreed. I think there is an issue is how the state is handled in this
error condition. The "stream" should not be re-sent but seems like that
state of the stream is not set to "done" or "don't re-issue". I don't have
a public URL but I do have a netty based server which will replicate the
scenario. See the attached patch to force the server to get curl into this
state (note that the server will be misbehaving and not sending the
":status" header back...but this is just to help debug curl in this error
condition).

Here is how to run the server with this patch:
1) Make sure you have java8 and mvn configured (let me know if you have
questions)
2) git clone https://github.com/netty/netty.git
3) cd netty
4) mvn clean install -DskipTests=true
5) patch p1 < netty_server_curl_issue.diff
6) ./run-example -Dssl -Dport=<port> http2-server

>
> No. First, we only deal with a single stream at a time on a connection for
> now. Then, to support multiple streams the plan is to do that using
> multiple easy handles that hold one stream each all using the same physical
> connection. Similar to how pipelining works for HTTP 1.1 within libcurl
> today.
>
>
Sounds good. Just wanted to make sure I wasn't missing something.

>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2014-10-10