|
59 | 59 | #define nghttp2_session_callbacks_set_error_callback(x,y) |
60 | 60 | #endif |
61 | 61 |
|
| 62 | +#define HTTP2_HUGE_WINDOW_SIZE (1 << 30) |
| 63 | + |
62 | 64 | /* |
63 | 65 | * Curl_http2_init_state() is called when the easy handle is created and |
64 | 66 | * allows for HTTP/2 specific init of state. |
@@ -965,7 +967,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session, |
965 | 967 | */ |
966 | 968 | static nghttp2_settings_entry settings[] = { |
967 | 969 | { NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100 }, |
968 | | - { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, NGHTTP2_INITIAL_WINDOW_SIZE }, |
| 970 | + { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, HTTP2_HUGE_WINDOW_SIZE }, |
969 | 971 | }; |
970 | 972 |
|
971 | 973 | #define H2_BUFSIZE 32768 |
@@ -2031,14 +2033,23 @@ CURLcode Curl_http2_switched(struct connectdata *conn, |
2031 | 2033 | else { |
2032 | 2034 | /* stream ID is unknown at this point */ |
2033 | 2035 | stream->stream_id = -1; |
2034 | | - rv = nghttp2_submit_settings(httpc->h2, NGHTTP2_FLAG_NONE, NULL, 0); |
| 2036 | + rv = nghttp2_submit_settings(httpc->h2, NGHTTP2_FLAG_NONE, settings, |
| 2037 | + sizeof(settings) / sizeof(settings[0])); |
2035 | 2038 | if(rv != 0) { |
2036 | 2039 | failf(data, "nghttp2_submit_settings() failed: %s(%d)", |
2037 | 2040 | nghttp2_strerror(rv), rv); |
2038 | 2041 | return CURLE_HTTP2; |
2039 | 2042 | } |
2040 | 2043 | } |
2041 | 2044 |
|
| 2045 | + rv = nghttp2_session_set_local_window_size(httpc->h2, NGHTTP2_FLAG_NONE, 0, |
| 2046 | + HTTP2_HUGE_WINDOW_SIZE); |
| 2047 | + if(rv != 0) { |
| 2048 | + failf(data, "nghttp2_session_set_local_window_size() failed: %s(%d)", |
| 2049 | + nghttp2_strerror(rv), rv); |
| 2050 | + return CURLE_HTTP2; |
| 2051 | + } |
| 2052 | + |
2042 | 2053 | /* we are going to copy mem to httpc->inbuf. This is required since |
2043 | 2054 | mem is part of buffer pointed by stream->mem, and callbacks |
2044 | 2055 | called by nghttp2_session_mem_recv() will write stream specific |
|
0 commit comments