2013-09-04 05:17:06 +08:00
|
|
|
#ifndef HEADER_CURL_HTTP2_H
|
|
|
|
#define HEADER_CURL_HTTP2_H
|
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2017-06-19 05:57:45 +08:00
|
|
|
* Copyright (C) 1998 - 2017, 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
|
2016-02-03 07:19:02 +08:00
|
|
|
* are also available at https://curl.haxx.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.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
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 */
|
|
|
|
#define DEFAULT_MAX_CONCURRENT_STREAMS 13
|
|
|
|
|
2013-09-04 05:17:06 +08: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-03-03 13:47:46 +08:00
|
|
|
const char *Curl_http2_strerror(uint32_t err);
|
|
|
|
|
2014-01-30 18:32:04 +08:00
|
|
|
CURLcode Curl_http2_init(struct connectdata *conn);
|
2015-09-13 22:07:05 +08:00
|
|
|
void Curl_http2_init_state(struct UrlState *state);
|
|
|
|
void Curl_http2_init_userset(struct UserDefined *set);
|
2014-01-30 18:32:04 +08:00
|
|
|
CURLcode Curl_http2_send_request(struct connectdata *conn);
|
|
|
|
CURLcode Curl_http2_request_upgrade(Curl_send_buffer *req,
|
|
|
|
struct connectdata *conn);
|
2014-06-14 06:11:01 +08:00
|
|
|
CURLcode Curl_http2_setup(struct connectdata *conn);
|
2014-11-13 01:07:24 +08:00
|
|
|
CURLcode Curl_http2_switched(struct connectdata *conn,
|
|
|
|
const char *data, size_t nread);
|
2015-05-11 17:41:10 +08:00
|
|
|
/* called from Curl_http_setup_conn */
|
|
|
|
void Curl_http2_setup_conn(struct connectdata *conn);
|
2016-06-21 21:47:12 +08:00
|
|
|
void Curl_http2_setup_req(struct Curl_easy *data);
|
2016-08-11 20:00:23 +08:00
|
|
|
void Curl_http2_done(struct connectdata *conn, bool premature);
|
2016-09-05 17:07:40 +08:00
|
|
|
CURLcode Curl_http2_done_sending(struct connectdata *conn);
|
2017-06-19 05:57:45 +08:00
|
|
|
CURLcode Curl_http2_add_child(struct Curl_easy *parent,
|
|
|
|
struct Curl_easy *child,
|
|
|
|
bool exclusive);
|
2016-11-15 07:32:00 +08:00
|
|
|
void Curl_http2_remove_child(struct Curl_easy *parent,
|
|
|
|
struct Curl_easy *child);
|
|
|
|
void Curl_http2_cleanup_dependencies(struct Curl_easy *data);
|
2013-09-07 17:03:23 +08:00
|
|
|
#else /* USE_NGHTTP2 */
|
2014-06-15 18:24:47 +08:00
|
|
|
#define Curl_http2_init(x) CURLE_UNSUPPORTED_PROTOCOL
|
|
|
|
#define Curl_http2_send_request(x) CURLE_UNSUPPORTED_PROTOCOL
|
|
|
|
#define Curl_http2_request_upgrade(x,y) CURLE_UNSUPPORTED_PROTOCOL
|
|
|
|
#define Curl_http2_setup(x) CURLE_UNSUPPORTED_PROTOCOL
|
2014-11-13 22:39:15 +08:00
|
|
|
#define Curl_http2_switched(x,y,z) CURLE_UNSUPPORTED_PROTOCOL
|
2015-05-11 17:41:10 +08:00
|
|
|
#define Curl_http2_setup_conn(x)
|
2015-06-01 20:20:57 +08:00
|
|
|
#define Curl_http2_setup_req(x)
|
2015-09-13 22:07:05 +08:00
|
|
|
#define Curl_http2_init_state(x)
|
|
|
|
#define Curl_http2_init_userset(x)
|
2016-08-11 20:00:23 +08:00
|
|
|
#define Curl_http2_done(x,y)
|
2016-09-05 17:07:40 +08:00
|
|
|
#define Curl_http2_done_sending(x)
|
2016-11-15 07:32:00 +08:00
|
|
|
#define Curl_http2_add_child(x, y, z)
|
|
|
|
#define Curl_http2_remove_child(x, y)
|
|
|
|
#define Curl_http2_cleanup_dependencies(x)
|
2013-09-07 17:03:23 +08:00
|
|
|
#endif
|
|
|
|
|
2013-09-04 05:17:06 +08:00
|
|
|
#endif /* HEADER_CURL_HTTP2_H */
|
|
|
|
|