84 lines
3.4 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 ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
2021-09-14 00:13:48 +02:00
* Copyright (C) 1998 - 2021, 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.
*
***************************************************************************/
#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
/*
* Store nghttp2 version info in this buffer, Prefix with a space. Return
* total length written.
*/
int Curl_http2_ver(char *p, size_t len);
2016-09-11 17:22:32 +02:00
const char *Curl_http2_strerror(uint32_t err);
2015-04-27 22:25:09 +02:00
CURLcode Curl_http2_init(struct connectdata *conn);
2016-09-11 17:22:32 +02:00
void Curl_http2_init_state(struct UrlState *state);
void Curl_http2_init_userset(struct UserDefined *set);
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);
CURLcode Curl_http2_setup(struct Curl_easy *data, struct connectdata *conn);
CURLcode Curl_http2_switched(struct Curl_easy *data,
const char *ptr, size_t nread);
2020-08-30 11:54:41 +02:00
/* called from http_setup_conn */
2015-11-17 17:22:37 +01:00
void Curl_http2_setup_conn(struct connectdata *conn);
2016-09-11 17:22:32 +02:00
void Curl_http2_setup_req(struct Curl_easy *data);
2020-08-30 11:54:41 +02:00
void Curl_http2_done(struct Curl_easy *data, bool premature);
2021-09-14 00:13:48 +02:00
CURLcode Curl_http2_done_sending(struct Curl_easy *data,
struct connectdata *conn);
2018-01-26 17:06:56 +01:00
CURLcode Curl_http2_add_child(struct Curl_easy *parent,
struct Curl_easy *child,
bool exclusive);
2017-07-20 19:35:53 +02:00
void Curl_http2_remove_child(struct Curl_easy *parent,
struct Curl_easy *child);
void Curl_http2_cleanup_dependencies(struct Curl_easy *data);
2020-08-30 11:54:41 +02:00
CURLcode Curl_http2_stream_pause(struct Curl_easy *data, bool pause);
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);
2015-04-27 22:25:09 +02:00
#else /* USE_NGHTTP2 */
#define Curl_http2_request_upgrade(x,y) CURLE_UNSUPPORTED_PROTOCOL
2021-09-14 00:13:48 +02:00
#define Curl_http2_setup(x,y) CURLE_UNSUPPORTED_PROTOCOL
2015-11-17 17:22:37 +01:00
#define Curl_http2_switched(x,y,z) CURLE_UNSUPPORTED_PROTOCOL
2018-10-28 12:09:07 +01:00
#define Curl_http2_setup_conn(x) Curl_nop_stmt
2015-11-17 17:22:37 +01:00
#define Curl_http2_setup_req(x)
2016-09-11 17:22:32 +02:00
#define Curl_http2_init_state(x)
#define Curl_http2_init_userset(x)
2017-04-14 19:02:05 +02:00
#define Curl_http2_done(x,y)
2021-09-14 00:13:48 +02:00
#define Curl_http2_done_sending(x,y)
2017-07-20 19:35:53 +02:00
#define Curl_http2_add_child(x, y, z)
#define Curl_http2_remove_child(x, y)
#define Curl_http2_cleanup_dependencies(x)
2020-08-30 11:54:41 +02:00
#define Curl_http2_stream_pause(x, y)
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 */