Skip to content

Add USE_HTTP2 define - #6959

Closed
jsha wants to merge 2 commits into
curl:masterfrom
jsha:use_http2
Closed

Add USE_HTTP2 define#6959
jsha wants to merge 2 commits into
curl:masterfrom
jsha:use_http2

Conversation

@jsha

@jsha jsha commented Apr 25, 2021

Copy link
Copy Markdown
Contributor

This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.

Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.

Fixes #6949.

@jsha jsha mentioned this pull request Apr 25, 2021
@bagder

bagder commented Apr 25, 2021

Copy link
Copy Markdown
Member

I think CMakeLists.txt also needs a fix for this?

@jsha

jsha commented Apr 25, 2021

Copy link
Copy Markdown
Contributor Author

I'm afraid I don't know CMake. Can you point me in roughly the right direction? I know I need to set the USE_HTTP2 #define when either Hyper or nghttp2 are enabled, but I can't see how #defines are added in the CMake config.

@bagder

bagder commented Apr 25, 2021

Copy link
Copy Markdown
Member

An alternative approach that works better independently of build system would be to mimic the QUIC way:

curl/lib/curl_setup.h

Lines 804 to 806 in 7843fe0

#if defined(USE_NGTCP2) || defined(USE_QUICHE)
#define ENABLE_QUIC
#endif

@bagder

bagder commented Apr 26, 2021

Copy link
Copy Markdown
Member
vtls/openssl.c:2717:24: error: incompatible pointer to integer conversion assigning to 'unsigned char' from 'const char [3]' [-Werror,-Wint-conversion]
      protocols[cur++] = ALPN_H2;

This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.

Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.
@bagder

bagder commented Apr 27, 2021

Copy link
Copy Markdown
Member

It looks like nss needs something similar?

vtls/nss.c:2112:24: error: incompatible pointer to integer conversion assigning to 'unsigned char' from 'const char [3]' [-Werror,-Wint-conversion]
      protocols[cur++] = ALPN_H2;
                       ^ ~~~~~~~

@Lionz01 Lionz01 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``

@bagder bagder closed this in a3268ec Apr 29, 2021
@bagder

bagder commented Apr 29, 2021

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

TLS backends rely on USE_NGHTTP2 to send "h2" ALPN

3 participants