Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

HTTP/2 and multi-streams

From: Stephane Bortzmeyer via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Wed, 15 Jan 2020 09:02:57 +0100

I'm trying to parallelize requests on HTTP/2 streams (not
connections). Whatever I do, pycurl only uses one stream per HTTP/2
connection.

What I did: following
<http://pycurl.io/docs/latest/curlmultiobject.html>, I:

m = pycurl.CurlMulti()
m.setopt(pycurl.M_PIPELINING, True)
m.add_handle(c)
m.add_handle(c2)
while True:
    status = m.select(2)
    (result, num) = m.perform()
    if num == 0:
        break

But setting the handles in verbose mode, I see that I do have HTTP/2:

* ALPN, server accepted to use h2
* Using HTTP2, server supports multi-use

But there is only one stream used, for first handle, then the second:

* Using Stream ID: 1 (easy handle 0x9bd768)
* Using Stream ID: 1 (easy handle 0x9c2718)

I used:

m.setopt(pycurl.M_PIPEWAIT, True)

But it changed nothing.

Is there some other magic to invoke to use several HTTP/2 streams?

Python 3.7.5
pycurl 7.43.0
libcurl 7.67.0

_______________________________________________
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2020-01-15