summaryrefslogtreecommitdiff
path: root/lib/http2.c
Commit message (Collapse)AuthorAgeFilesLines
* http2: clear the "drain counter" when a stream is closedbagder/http2-drain-unsyncDaniel Stenberg2018-04-191-0/+1
| | | | | | | | | This fixes the notorious "httpc->drain_total >= data->state.drain" assert. Reported-by: Anders Bakken Fixes #1680
* http2: handle on_begin_headers() called more than onceDaniel Stenberg2018-04-191-8/+4
| | | | | | | | | | | This triggered an assert if called more than once in debug mode (and a memory leak if not debug build). With the right sequence of HTTP/2 headers incoming it can happen. Detected by OSS-Fuzz Closes #2507 Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7764
* http2: read pending frames (including GOAWAY) in connection-checkDaniel Stenberg2018-03-221-13/+41
| | | | | | | | | | If a connection has received a GOAWAY frame while not being used, the function now reads frames off the connection before trying to reuse it to avoid reusing connections the server has told us not to use. Reported-by: Alex Baines Fixes #1967 Closes #2402
* http2: fixes typoKobi Gurkan2018-03-151-1/+1
| | | | Closes #2387
* http2: mark the connection for close on GOAWAYDaniel Stenberg2018-03-121-12/+21
| | | | | | | | | ... don't consider it an error! Assisted-by: Jay Satiro Reported-by: Łukasz Domeradzki Fixes #2365 Closes #2375
* http2: verbose output new MAX_CONCURRENT_STREAMS valuesDaniel Stenberg2018-03-101-1/+2
| | | | ... as it is interesting for many users.
* TODO fixed: Detect when called from within callbacksBjörn Stenberg2018-02-151-0/+2
| | | | Closes #2302
* http2: set DEBUG_HTTP2 to enable more HTTP/2 loggingDaniel Stenberg2018-01-301-60/+66
| | | | | ... instead of doing it unconditionally in debug builds. It cluttered up the output a little too much.
* http2: fix incorrect trailer buffer sizeZhouyihai Ding2018-01-111-2/+2
| | | | | | | | | | | | | | | Prior to this change the stored byte count of each trailer was miscalculated and 1 less than required. It appears any trailer after the first that was passed to Curl_client_write would be truncated or corrupted as well as the size. Potentially the size of some subsequent trailer could be erroneously extracted from the contents of that trailer, and since that size is used by client write an out-of-bounds read could occur and cause a crash or be otherwise processed by client write. The bug appears to have been born in 0761a51 (precedes 7.49.0). Closes https://github.com/curl/curl/pull/2231
* http2: fix "Value stored to 'end' is never read" scan-build errorDaniel Stenberg2017-11-211-1/+0
|
* http2: fix "Value stored to 'hdbuf' is never read" scan-build errorDaniel Stenberg2017-11-211-2/+0
|
* http2: Fixed OOM handling in upgrade requestDan Fandrich2017-11-011-1/+4
| | | | This caused the torture tests on test 1800 to fail.
* include: remove conncache.h inclusion from where its not neededDaniel Stenberg2017-11-011-1/+0
|
* code style: use spaces around plusesDaniel Stenberg2017-09-111-1/+1
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-2/+2
|
* mime: new MIME API.Patrick Monnerat2017-09-021-0/+1
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* http2_recv: return error better on fatal h2 errorsDaniel Stenberg2017-08-181-2/+2
| | | | | Ref #1012 Figured-out-by: Tatsuhiro Tsujikawa
* http2: handle PING framesMax Dymond2017-06-301-2/+46
| | | | | | | Add a connection check function to HTTP2 based off RTSP. This causes PINGs to be handled the next time the connection is reused. Closes #1521
* handler: refactor connection checkingMax Dymond2017-06-301-0/+2
| | | | | | Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
* http2: fix OOM crashDaniel Stenberg2017-06-181-2/+6
| | | | torture mode with test 1021 found it
* test1521: test *all* curl_easy_setopt optionsDaniel Stenberg2017-06-051-22/+24
| | | | | | | | | | | | | mk-lib1521.pl generates a test program (lib1521.c) that calls curl_easy_setopt() for every known option with a few typical values to make sure they work (ignoring the return codes). Some small changes were necessary to avoid asserts and NULL accesses when doing this. The perl script needs to be manually rerun when we add new options. Closes #1543
* assert: avoid, use DEBUGASSERT instead!Daniel Stenberg2017-05-221-2/+2
| | | | | | | ... as it does extra checks to actually work. Reported-by: jonrumsey at github Fixes #1504
* multi: use a fixed array of timers instead of mallocDaniel Stenberg2017-05-101-4/+4
| | | | | | | | | | ... since the total amount is low this is faster, easier and reduces memory overhead. Also, Curl_expire_done() can now mark an expire timeout as done so that it never times out. Closes #1472
* multi: assign IDs to all timers and make each timer singletonDaniel Stenberg2017-05-101-4/+4
| | | | | | | A) reduces the timeout lists drastically B) prevents a lot of superfluous loops for timers that expires "in vain" when it has actually already been extended to fire later on
* http2: use the correct set buffer sizeDaniel Stenberg2017-05-011-1/+1
|
* http2: declare TU-local variables staticMarcel Raad2017-04-301-2/+2
| | | | | | | | | | This fixes the following clang warnings: http2.c:184:27: error: no previous extern declaration for non-static variable 'Curl_handler_http2' [-Werror,-Wmissing-variable-declarations] http2.c:204:27: error: no previous extern declaration for non-static variable 'Curl_handler_http2_ssl' [-Werror,-Wmissing-variable-declarations]
* http2: fix handle leak in error pathLarry Stefani2017-04-151-0/+1
| | | | | | Add missing newhandle free call in push_promise(). Closes #1416
* http2: silence unused parameter warningsMarcel Raad2017-03-301-0/+6
| | | | | In release mode, MinGW complains: error: unused parameter 'lib_error_code' [-Werror=unused-parameter]
* http2: fix memory-leak when denying push streamsDaniel Stenberg2017-02-131-11/+19
| | | | | Reported-by: zelinchen@users.noreply.github.com Fixes #1229
* http2: reset push header counter fixes crashDaniel Stenberg2017-02-071-0/+1
| | | | | | | | | When removing an easy handler from a multi before it completed its transfer, and it had pushed streams, it would segfault due to the pushed counted not being cleared. Fixed-by: zelinchen@users.noreply.github.com Fixes #1249
* http2: disable server push if not requestedAlessandro Ghedini2017-01-151-16/+26
| | | | Ref: https://github.com/curl/curl/pull/1160
* http2_send: avoid unsigned integer wrap aroundDaniel Stenberg2017-01-111-12/+6
| | | | ... when checking for a too large request.
* http2: check nghttp2_session_set_local_window_size existsJay Satiro2016-11-281-0/+6
| | | | | | | The function only exists since nghttp2 1.12.0. Bug: https://github.com/curl/curl/commit/a4d8888#commitcomment-19985676 Reported-by: Michael Kaufmann
* http2: Fix crashes when parent stream gets abortedAnders Bakken2016-11-281-0/+76
| | | | Closes #1125
* checksrc: move open braces to comply with function declaration styleDaniel Stenberg2016-11-241-2/+4
|
* checksrc: white space edits to comply to stricter checksrcDaniel Stenberg2016-11-241-1/+1
|
* http2: Use huge HTTP/2 windowsJay Satiro2016-11-161-2/+13
| | | | | | | | - Improve performance by using a huge HTTP/2 window size. Bug: https://github.com/curl/curl/issues/1102 Reported-by: afrind@users.noreply.github.com Assisted-by: Tatsuhiro Tsujikawa
* http2: Fix address sanitizer memcpy warningJay Satiro2016-11-161-1/+2
| | | | | | | | | | | | | | | | | - In Curl_http2_switched don't call memcpy when src is NULL. Curl_http2_switched can be called like: Curl_http2_switched(conn, NULL, 0); .. and prior to this change memcpy was then called like: memcpy(dest, NULL, 0) .. causing address sanitizer to warn: http2.c:2057:3: runtime error: null pointer passed as argument 2, which is declared to never be null
* realloc: use Curl_saferealloc to avoid common mistakesDaniel Stenberg2016-11-111-4/+3
| | | | Discussed: https://curl.haxx.se/mail/lib-2016-11/0087.html
* http2: Don't send header fields prohibited by HTTP/2 specTatsuhiro Tsujikawa2016-11-071-14/+85
| | | | | | | | | | | Previously, we just ignored "Connection" header field. But HTTP/2 specification actually prohibits few more header fields. This commit ignores all of them so that we don't send these bad header fields. Bug: https://curl.haxx.se/mail/archive-2016-10/0033.html Reported-by: Ricki Hirner Closes https://github.com/curl/curl/pull/1092
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-4/+4
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* http2: debug ouput sent HTTP/2 request headersDaniel Stenberg2016-09-161-0/+4
|
* http2: support > 64bit sized uploadsDaniel Stenberg2016-09-091-1/+2
| | | | | | | ... by making sure we don't count down the "upload left" counter when the uploaded size is unknown and then it can be allowed to continue forever. Fixes #996
* http2: return EOF when done uploading without known sizeDaniel Stenberg2016-09-051-2/+35
| | | | Fixes #982
* http2: skip the content-length parsing, detect unknown sizeDaniel Stenberg2016-09-051-22/+6
|
* http2: minor white space editDaniel Stenberg2016-09-051-2/+3
|
* http2: use named define instead of magic constant in read callbackDaniel Stenberg2016-09-051-1/+1
|
* http2: return CURLE_HTTP2_STREAM for unexpected stream closeDaniel Stenberg2016-08-281-3/+2
| | | | | | Follow-up to c3e906e9cd0f, seems like a more appropriate error code Suggested-by: Jay Satiro
* http2: handle closed streams when uploadingTatsuhiro Tsujikawa2016-08-281-0/+11
| | | | Fixes #986
* http2: make sure stream errors don't needlessly close the connectionDaniel Stenberg2016-08-281-3/+45
| | | | | | | | With HTTP/2 each transfer is made in an indivial logical stream over the connection, making most previous errors that caused the connection to get forced-closed now instead just kill the stream and not the connection. Fixes #941