summaryrefslogtreecommitdiff
path: root/lib/http2.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* http2: Remove incorrect commentsJay Satiro2016-08-251-5/+0
| | | | .. also remove same from scp
* http2: always wait for readable socketDaniel Stenberg2016-08-051-2/+3
| | | | | | | | Since the server can at any time send a HTTP/2 frame to us, we need to wait for the socket to be readable during all transfers so that we can act on incoming frames even when uploading etc. Reminded-by: Tatsuhiro Tsujikawa
* CURLOPT_TCP_NODELAY: now enabled by defaultDaniel Stenberg2016-08-051-4/+0
| | | | | | | | | | | | | | After a few wasted hours hunting down the reason for slowness during a TLS handshake that turned out to be because of TCP_NODELAY not being set, I think we have enough motivation to toggle the default for this option. We now enable TCP_NODELAY by default and allow applications to switch it off. This also makes --tcp-nodelay unnecessary, but --no-tcp-nodelay can be used to disable it. Thanks-to: Tim Rühsen Bug: https://curl.haxx.se/mail/lib-2016-06/0143.html
* multi: make Curl_expire() work with 0 ms timeoutsDaniel Stenberg2016-08-041-5/+4
| | | | | | | | | | Previously, passing a timeout of zero to Curl_expire() was a magic code for clearing all timeouts for the handle. That is now instead made with the new Curl_expire_clear() function and thus a 0 timeout is fine to set and will trigger a timeout ASAP. This will help removing short delays, in particular notable when doing HTTP/2.
* typedefs: use the full structs in internal code...Daniel Stenberg2016-06-221-1/+1
| | | | ... and save the typedef'ed names for headers and external APIs.
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-25/+25
|
* http2: use HTTP/2 in the HTTP/1.1-alike headerDaniel Stenberg2016-05-191-1/+1
| | | | | ... when generating them, not "2.0" as the protocol is called just HTTP/2 and nothing else.
* http2: Add space between colon and header valueCory Benfield2016-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | curl's representation of HTTP/2 responses involves transforming the response to a format that is similar to HTTP/1.1. Prior to this change, curl would do this by separating header names and values with only a colon, without introducing a space after the colon. While this is technically a valid way to represent a HTTP/1.1 header block, it is much more common to see a space following the colon. This change introduces that space, to ensure that incautious tools are safely able to parse the header block. This also ensures that the difference between the HTTP/1.1 and HTTP/2 response layout is as minimal as possible. Bug: https://github.com/curl/curl/issues/797 Closes #798 Fixes #797
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743