78 lines
2.7 KiB
C
Raw Normal View History

2015-04-27 22:25:09 +02:00
#ifndef HEADER_CURL_HTTP2_H
#define HEADER_CURL_HTTP2_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
2023-07-02 19:51:09 +02:00
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2015-04-27 22:25:09 +02:00
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
2021-09-14 00:13:48 +02:00
* are also available at https://curl.se/docs/copyright.html.
2015-04-27 22:25:09 +02: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.
*
2022-11-16 20:14:03 +01:00
* SPDX-License-Identifier: curl
*
2015-04-27 22:25:09 +02:00
***************************************************************************/
#include "curl_setup.h"
#ifdef USE_NGHTTP2
#include "http.h"
2015-11-17 17:22:37 +01:00
/* value for MAX_CONCURRENT_STREAMS we use until we get an updated setting
from the peer */
2021-09-14 00:13:48 +02:00
#define DEFAULT_MAX_CONCURRENT_STREAMS 100
2015-11-17 17:22:37 +01:00
2015-04-27 22:25:09 +02:00
/*
2021-11-20 13:41:27 +01:00
* Store nghttp2 version info in this buffer.
2015-04-27 22:25:09 +02:00
*/
2021-11-20 13:41:27 +01:00
void Curl_http2_ver(char *p, size_t len);
2015-04-27 22:25:09 +02:00
2020-08-30 11:54:41 +02:00
CURLcode Curl_http2_request_upgrade(struct dynbuf *req,
2021-09-14 00:13:48 +02:00
struct Curl_easy *data);
2019-11-11 23:01:05 +01:00
/* returns true if the HTTP/2 stream error was HTTP_1_1_REQUIRED */
2021-09-14 00:13:48 +02:00
bool Curl_h2_http_1_1_error(struct Curl_easy *data);
2023-07-02 19:51:09 +02: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);
CURLcode Curl_http2_switch_at(struct Curl_cfilter *cf, struct Curl_easy *data);
CURLcode Curl_http2_upgrade(struct Curl_easy *data,
struct connectdata *conn, int sockindex,
const char *ptr, size_t nread);
extern struct Curl_cftype Curl_cft_nghttp2;
2015-04-27 22:25:09 +02:00
#else /* USE_NGHTTP2 */
2023-07-02 19:51:09 +02:00
#define Curl_cf_is_http2(a,b) FALSE
#define Curl_conn_is_http2(a,b,c) FALSE
#define Curl_http2_may_switch(a,b,c) FALSE
2015-04-27 22:25:09 +02:00
#define Curl_http2_request_upgrade(x,y) CURLE_UNSUPPORTED_PROTOCOL
2023-07-02 19:51:09 +02:00
#define Curl_http2_switch(a,b,c) CURLE_UNSUPPORTED_PROTOCOL
#define Curl_http2_upgrade(a,b,c,d,e) CURLE_UNSUPPORTED_PROTOCOL
2019-11-11 23:01:05 +01:00
#define Curl_h2_http_1_1_error(x) 0
2015-04-27 22:25:09 +02:00
#endif
#endif /* HEADER_CURL_HTTP2_H */