aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-11-28 14:08:35 -0500
committerJay Satiro <raysatiro@yahoo.com>2016-11-28 14:08:35 -0500
commit19613fb355b480f395a5a68c32fa7c877ead6092 (patch)
treef88cff8c21eb2ae4c365d6e5e8ef7b0445db27c4 /lib/http2.c
parent421f740164cf53ef9dfb6bc96d0b6a8321b32fd5 (diff)
http2: check nghttp2_session_set_local_window_size exists
The function only exists since nghttp2 1.12.0. Bug: https://github.com/curl/curl/commit/a4d8888#commitcomment-19985676 Reported-by: Michael Kaufmann
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 16684da9d..4cc17ba2b 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -59,6 +59,10 @@
#define nghttp2_session_callbacks_set_error_callback(x,y)
#endif
+#if (NGHTTP2_VERSION_NUM >= 0x010c00)
+#define NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE 1
+#endif
+
#define HTTP2_HUGE_WINDOW_SIZE (1 << 30)
/*
@@ -2044,6 +2048,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
}
}
+#ifdef NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE
rv = nghttp2_session_set_local_window_size(httpc->h2, NGHTTP2_FLAG_NONE, 0,
HTTP2_HUGE_WINDOW_SIZE);
if(rv != 0) {
@@ -2051,6 +2056,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
nghttp2_strerror(rv), rv);
return CURLE_HTTP2;
}
+#endif
/* we are going to copy mem to httpc->inbuf. This is required since
mem is part of buffer pointed by stream->mem, and callbacks