summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/http2.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-14 15:03:53 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-14 15:10:22 (GMT)
commita3ef36f153f51c33ea2154cff17bbf9abb7ee073 (patch)
tree94283929f1d08444c255a490d10810d7c5df0e04 /Utilities/cmcurl/lib/http2.c
parent91101f108d68e8fe98c378f06e1ed12a513151fe (diff)
parent06d6d6c4aee149cd6560b919ef6935ef0867d921 (diff)
downloadCMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.zip
CMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.tar.gz
CMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2017-06-14 (54b636f1) Resolve a logical conflict in `Utilities/cmcurl/CMakeLists.txt` by disabling CA bundle/path detection for build within CMake. CMake already handles locating a CA bundle/path at runtime.
Diffstat (limited to 'Utilities/cmcurl/lib/http2.c')
-rw-r--r--Utilities/cmcurl/lib/http2.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/Utilities/cmcurl/lib/http2.c b/Utilities/cmcurl/lib/http2.c
index 264c667..f8e23c5 100644
--- a/Utilities/cmcurl/lib/http2.c
+++ b/Utilities/cmcurl/lib/http2.c
@@ -165,7 +165,7 @@ void Curl_http2_setup_req(struct Curl_easy *data)
http->closed = FALSE;
http->close_handled = FALSE;
http->mem = data->state.buffer;
- http->len = BUFSIZE;
+ http->len = data->set.buffer_size;
http->memlen = 0;
}
@@ -181,7 +181,7 @@ void Curl_http2_setup_conn(struct connectdata *conn)
* but will be used at run-time when the protocol is dynamically switched from
* HTTP to HTTP2.
*/
-const struct Curl_handler Curl_handler_http2 = {
+static const struct Curl_handler Curl_handler_http2 = {
"HTTP", /* scheme */
ZERO_NULL, /* setup_connection */
Curl_http, /* do_it */
@@ -201,7 +201,7 @@ const struct Curl_handler Curl_handler_http2 = {
PROTOPT_STREAM /* flags */
};
-const struct Curl_handler Curl_handler_http2_ssl = {
+static const struct Curl_handler Curl_handler_http2_ssl = {
"HTTPS", /* scheme */
ZERO_NULL, /* setup_connection */
Curl_http, /* do_it */
@@ -569,7 +569,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
/* if we receive data for another handle, wake that up */
if(conn_s->data != data_s)
- Curl_expire(data_s, 0);
+ Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
}
break;
case NGHTTP2_PUSH_PROMISE:
@@ -646,7 +646,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 0);
+ Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
DEBUGF(infof(data_s, "%zu data received for stream %u "
"(%zu left in buffer %p, total %zu)\n",
@@ -784,7 +784,7 @@ static int on_begin_headers(nghttp2_session *session,
/* This is trailer HEADERS started. Allocate buffer for them. */
DEBUGF(infof(data_s, "trailer field started\n"));
- assert(stream->trailer_recvbuf == NULL);
+ DEBUGASSERT(stream->trailer_recvbuf == NULL);
stream->trailer_recvbuf = Curl_add_buffer_init();
if(!stream->trailer_recvbuf) {
@@ -909,7 +909,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
Curl_add_buffer(stream->header_recvbuf, " \r\n", 3);
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 0);
+ Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
DEBUGF(infof(data_s, "h2 status: HTTP/2 %03d (easy %p)\n",
stream->status_code, data_s));
@@ -925,7 +925,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
Curl_add_buffer(stream->header_recvbuf, "\r\n", 2);
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 0);
+ Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
DEBUGF(infof(data_s, "h2 header: %.*s: %.*s\n", namelen, name, valuelen,
value));
@@ -1453,7 +1453,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
infof(data, "%zu data bytes written\n", nread);
if(stream->pauselen == 0) {
DEBUGF(infof(data, "Unpaused by stream %u\n", stream->stream_id));
- assert(httpc->pause_stream_id == stream->stream_id);
+ DEBUGASSERT(httpc->pause_stream_id == stream->stream_id);
httpc->pause_stream_id = 0;
stream->pausedata = NULL;
@@ -2137,35 +2137,37 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
void Curl_http2_add_child(struct Curl_easy *parent, struct Curl_easy *child,
bool exclusive)
{
- struct Curl_http2_dep **tail;
- struct Curl_http2_dep *dep = calloc(1, sizeof(struct Curl_http2_dep));
- dep->data = child;
-
- if(parent->set.stream_dependents && exclusive) {
- struct Curl_http2_dep *node = parent->set.stream_dependents;
- while(node) {
- node->data->set.stream_depends_on = child;
- node = node->next;
+ if(parent) {
+ struct Curl_http2_dep **tail;
+ struct Curl_http2_dep *dep = calloc(1, sizeof(struct Curl_http2_dep));
+ dep->data = child;
+
+ if(parent->set.stream_dependents && exclusive) {
+ struct Curl_http2_dep *node = parent->set.stream_dependents;
+ while(node) {
+ node->data->set.stream_depends_on = child;
+ node = node->next;
+ }
+
+ tail = &child->set.stream_dependents;
+ while(*tail)
+ tail = &(*tail)->next;
+
+ DEBUGASSERT(!*tail);
+ *tail = parent->set.stream_dependents;
+ parent->set.stream_dependents = 0;
}
- tail = &child->set.stream_dependents;
- while(*tail)
+ tail = &parent->set.stream_dependents;
+ while(*tail) {
+ (*tail)->data->set.stream_depends_e = FALSE;
tail = &(*tail)->next;
+ }
DEBUGASSERT(!*tail);
- *tail = parent->set.stream_dependents;
- parent->set.stream_dependents = 0;
+ *tail = dep;
}
- tail = &parent->set.stream_dependents;
- while(*tail) {
- (*tail)->data->set.stream_depends_e = FALSE;
- tail = &(*tail)->next;
- }
-
- DEBUGASSERT(!*tail);
- *tail = dep;
-
child->set.stream_depends_on = parent;
child->set.stream_depends_e = exclusive;
}