2013-09-04 05:17:06 +08:00
|
|
|
#ifndef HEADER_CURL_HTTP2_H
|
|
|
|
#define HEADER_CURL_HTTP2_H
|
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2023-01-02 20:51:48 +08:00
|
|
|
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2013-09-04 05:17:06 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2013-09-04 05:17:06 +08:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
*
|
2013-09-04 05:17:06 +08:00
|
|
|
***************************************************************************/
|
|
|
|
|
2013-09-07 17:03:23 +08:00
|
|
|
#include "curl_setup.h"
|
|
|
|
|
|
|
|
#ifdef USE_NGHTTP2
|
|
|
|
#include "http.h"
|
2015-05-11 17:41:10 +08:00
|
|
|
|
|
|
|
/* value for MAX_CONCURRENT_STREAMS we use until we get an updated setting
|
|
|
|
from the peer */
|
2021-04-05 23:51:19 +08:00
|
|
|
#define DEFAULT_MAX_CONCURRENT_STREAMS 100
|
2015-05-11 17:41:10 +08:00
|
|
|
|
2013-09-04 05:17:06 +08:00
|
|
|
/*
|
2021-06-30 17:09:55 +08:00
|
|
|
* Store nghttp2 version info in this buffer.
|
2013-09-04 05:17:06 +08:00
|
|
|
*/
|
2021-06-30 17:09:55 +08:00
|
|
|
void Curl_http2_ver(char *p, size_t len);
|
2013-09-04 05:17:06 +08:00
|
|
|
|
2016-03-03 13:47:46 +08:00
|
|
|
const char *Curl_http2_strerror(uint32_t err);
|
|
|
|
|
2020-05-02 23:04:08 +08:00
|
|
|
CURLcode Curl_http2_request_upgrade(struct dynbuf *req,
|
2021-02-15 15:35:32 +08:00
|
|
|
struct Curl_easy *data);
|
2018-12-08 00:04:39 +08:00
|
|
|
|
|
|
|
/* returns true if the HTTP/2 stream error was HTTP_1_1_REQUIRED */
|
2021-04-19 19:15:05 +08:00
|
|
|
bool Curl_h2_http_1_1_error(struct Curl_easy *data);
|
2022-12-30 16:14:55 +08:00
|
|
|
|
|
|
|
bool Curl_conn_is_http2(const struct Curl_easy *data,
|
|
|
|
const struct connectdata *conn,
|
|
|
|
int sockindex);
|
|
|
|
|
|
|
|
bool Curl_http2_may_switch(struct Curl_easy *data,
|
|
|
|
struct connectdata *conn,
|
|
|
|
int sockindex);
|
|
|
|
|
|
|
|
CURLcode Curl_http2_switch(struct Curl_easy *data,
|
|
|
|
struct connectdata *conn, int sockindex,
|
|
|
|
const char *ptr, size_t nread);
|
|
|
|
|
2023-01-11 17:30:42 +08:00
|
|
|
extern struct Curl_cftype Curl_cft_nghttp2;
|
|
|
|
|
2013-09-07 17:03:23 +08:00
|
|
|
#else /* USE_NGHTTP2 */
|
2022-12-30 16:14:55 +08:00
|
|
|
|
|
|
|
#define Curl_conn_is_http2(a,b,c) FALSE
|
|
|
|
#define Curl_http2_may_switch(a,b,c) FALSE
|
|
|
|
|
2014-06-15 18:24:47 +08:00
|
|
|
#define Curl_http2_request_upgrade(x,y) CURLE_UNSUPPORTED_PROTOCOL
|
2022-12-30 16:14:55 +08:00
|
|
|
#define Curl_http2_switch(a,b,c,d,e) CURLE_UNSUPPORTED_PROTOCOL
|
2018-12-08 00:04:39 +08:00
|
|
|
#define Curl_h2_http_1_1_error(x) 0
|
2013-09-07 17:03:23 +08:00
|
|
|
#endif
|
|
|
|
|
2013-09-04 05:17:06 +08:00
|
|
|
#endif /* HEADER_CURL_HTTP2_H */
|