Refactor ALPN/NPN protocol selection and introduce NGHTTP2_PROTO_ALPN macro

This commit is contained in:
Tatsuhiro Tsujikawa
2015-02-06 21:45:14 +09:00
parent 4956bdc4da
commit 33879219ff
5 changed files with 66 additions and 61 deletions

View File

@@ -49,6 +49,24 @@ extern "C" {
*/
#define NGHTTP2_PROTO_VERSION_ID_LEN 5
/**
* @macro
*
* The seriazlied form of ALPN protocol identifier this library
* supports. Notice that first byte is the length of following
* protocol identifier. This is the same wire format of `TLS ALPN
* extension <https://tools.ietf.org/html/rfc7301>`_. This is useful
* to process incoming ALPN tokens in wire format.
*/
#define NGHTTP2_PROTO_ALPN "\x5h2-14"
/**
* @macro
*
* The length of :macro:`NGHTTP2_PROTO_ALPN`.
*/
#define NGHTTP2_PROTO_ALPN_LEN (sizeof(NGHTTP2_PROTO_ALPN) - 1)
/**
* @macro
*