summaryrefslogtreecommitdiff
path: root/lib/http.h
Commit message (Collapse)AuthorAgeFilesLines
* build: repair http disabled but mqtt enabled buildDaniel Stenberg2020-12-181-11/+11
| | | | | | ... as the mqtt code reuses the "method" originally used for HTTP. Closes #6344
* lib: introduce c-hyper for using HyperDaniel Stenberg2020-12-181-2/+53
| | | | ... as an alternative HTTP backend within libcurl.
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* h2: repair trailer handlingDaniel Stenberg2020-08-031-0/+1
| | | | | | | | | | | | | The previous h2 trailer fix in 54a2b63 was wrong and caused a regression: it cannot deal with trailers immediately when read since they may be read off the connection by the wrong 'data' owner. This change reverts the logic back to gathering all trailers into a single buffer, like before 54a2b63. Reported-by: Tadej Vengust Fixes #5663 Closes #5769
* http2: simplify and clean up trailer handlingDaniel Stenberg2020-05-071-1/+0
| | | | | | | | | | | | Triggered by a crash detected by OSS-Fuzz after the dynbuf introduction in ed35d6590e72. This should make the trailer handling more straight forward and hopefully less error-prone. Deliver the trailer header to the callback already at receive-time. No longer caches the trailers to get delivered at end of stream. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22030 Closes #5348
* ngtcp2: convert to dynbufDaniel Stenberg2020-05-041-3/+1
| | | | Closes #5335
* dynbuf: introduce internal generic dynamic buffer functionsDaniel Stenberg2020-05-041-32/+13
| | | | | | | | | | | | | A common set of functions instead of many separate implementations for creating buffers that can grow when appending data to them. Existing functionality has been ported over. In my early basic testing, the total number of allocations seem at roughly the same amount as before, possibly a few less. See docs/DYNBUF.md for a description of the API. Closes #5300
* http.h: Copyright year out of date, should be 2020Daniel Stenberg2020-01-201-1/+1
| | | | Follow-up to 7ff9222ced8c
* HTTP: increase EXPECT_100_THRESHOLD to 1Mb加藤郁之2020-01-201-1/+1
| | | | | | Mentioned: https://curl.haxx.se/mail/lib-2020-01/0050.html Closes #4814
* ngtcp2: use overflow buffer for extra HTTP/3 dataJavier Blazquez2019-11-181-0/+4
| | | | | Fixes #4525 Closes #4603
* ngtcp2: increase QUIC window size when data is consumedDaniel Stenberg2019-11-161-0/+1
| | | | | | Assisted-by: Javier Blazquez Ref #4525 (partial fix) Closes #4600
* chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING errorDaniel Stenberg2019-10-021-5/+0
| | | | | | | | | Unknown content-encoding would get returned as CURLE_WRITE_ERROR if the response is chunked-encoded. Reported-by: Ilya Kosarev Fixes #4310 Closes #4449
* Curl_fillreadbuffer: avoid double-free trailer buf on errorbagder/trailer-buf-freeDaniel Stenberg2019-09-091-1/+1
| | | | | | | Reviewed-by: Jay Satiro Reported-by: Thomas Vegas Closes #4307
* http: the 'closed' struct field is used by both ngh2 and ngh3Daniel Stenberg2019-08-241-1/+1
| | | | | | | | and remove 'header_recvbuf', not used for anything Reported-by: Jeremy Lainé Closes #4257
* ngtcp2: accept upload via callbackDaniel Stenberg2019-08-231-0/+8
| | | | Closes #4256
* ngtcp2: initial h3 request workDaniel Stenberg2019-08-121-3/+5
| | | | Closes #4217
* http3: make connection reuse workDaniel Stenberg2019-08-091-0/+1
| | | | Closes #4204
* quiche: first working HTTP/3 requestDaniel Stenberg2019-08-061-4/+7
| | | | | | | | | - enable debug log - fix use of quiche API - use download buffer - separate header/body Closes #4193
* quiche: initial h3 request send/receiveDaniel Stenberg2019-08-051-0/+5
|
* http: allow overriding timecond with custom headerPeter Simonyi2019-07-141-1/+1
| | | | | | | | | With CURLOPT_TIMECONDITION set, a header is automatically added (e.g. If-Modified-Since). Allow this to be replaced or suppressed with CURLOPT_HTTPHEADER. Fixes #4103 Closes #4109
* headers: Remove no longer exported functionsDaniel Gustafsson2019-07-101-3/+0
| | | | | | | | | | | | | | | | | | | | There were a leftover few prototypes of Curl_ functions that we used to export but no longer do, this removes those prototypes and cleans up any comments still referring to them. Curl_write32_le(), Curl_strcpy_url(), Curl_strlen_url(), Curl_up_free() Curl_concat_url(), Curl_detach_connnection(), Curl_http_setup_conn() were made static in 05b100aee247bb9bec8e9a1b0166496aa4248d1c. Curl_http_perhapsrewind() made static in 574aecee208f79d391f10d57520b3. For the remainder, I didn't trawl the Git logs hard enough to capture their exact time of deletion, but they were all gone: Curl_splayprint(), Curl_http2_send_request(), Curl_global_host_cache_dtor(), Curl_scan_cache_used(), Curl_hostcache_destroy(), Curl_second_connect(), Curl_http_auth_stage() and Curl_close_connections(). Closes #4096 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* urldata: simplify bytecountersDaniel Stenberg2019-03-011-4/+2
| | | | | | | | | | | | | - no need to have them protocol specific - no need to set pointers to them with the Curl_setup_transfer() call - make Curl_setup_transfer() operate on a transfer pointer, not connection - switch some counters from long to the more proper curl_off_t type Closes #3627
* http: Implement trailing headers for chunked transfersAyoub Boudhar2018-12-141-0/+3
| | | | | | | | | | | | | This adds the CURLOPT_TRAILERDATA and CURLOPT_TRAILERFUNCTION options that allow a callback based approach to sending trailing headers with chunked transfers. The test server (sws) was updated to take into account the detection of the end of transfer in the case of trailing headers presence. Test 1591 checks that trailing headers can be sent using libcurl. Closes #3350
* whitespace fixesViktor Szakats2018-09-231-1/+0
| | | | | | | | | | | - replace tabs with spaces where possible - remove line ending spaces - remove double/triple newlines at EOF - fix a non-UTF-8 character - cleanup a few indentations/line continuations in manual examples Closes https://github.com/curl/curl/pull/3037
* http: made Curl_add_buffer functions take a pointer-pointerDaniel Stenberg2018-09-161-7/+11
| | | | | | | ... so that they can clear the original pointer on failure, which makes the error-paths and their cleanups easier. Closes #2992
* http2: use the correct function pointer typedefDaniel Stenberg2018-05-141-6/+2
| | | | | | | Fixes gcc-8 picky compiler warnings Reported-by: Rikard Falkeborn Bug: #2560 Closes #2568
* cleanup: misc typos in strings and commentsluz.paz2018-03-161-1/+1
| | | | | | Found via `codespell` Closes #2389
* http2: mark the connection for close on GOAWAYDaniel Stenberg2018-03-121-3/+2
| | | | | | | | | ... don't consider it an error! Assisted-by: Jay Satiro Reported-by: Łukasz Domeradzki Fixes #2365 Closes #2375
* Curl_checkheaders: make it available for IMAP and SMTP tooDaniel Stenberg2017-09-111-2/+0
| | | | | | ... not only HTTP uses this now. Closes #1875
* mime: unified to use the typedef'd mime structs everywhereDaniel Stenberg2017-09-051-2/+2
| | | | ... and slightly edited to follow our code style better.
* mime: new MIME API.Patrick Monnerat2017-09-021-2/+2
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* http: s/TINY_INITIAL_POST_SIZE/EXPECT_100_THRESHOLDDaniel Stenberg2017-07-061-3/+8
| | | | | Make the name reflect its use better, and add a short comment describing what it's for.
* http2: disable server push if not requestedAlessandro Ghedini2017-01-151-0/+4
| | | | Ref: https://github.com/curl/curl/pull/1160
* http2: handle closed streams when uploadingTatsuhiro Tsujikawa2016-08-281-0/+1
| | | | Fixes #986
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-4/+4
|
* http2: Use size_t type for data drain countJay Satiro2016-04-121-1/+1
| | | | | Ref: https://github.com/curl/curl/issues/659 Ref: https://github.com/curl/curl/pull/663
* http2: Ensure that http2_handle_stream_close is calledTatsuhiro Tsujikawa2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | This commit ensures that streams which was closed in on_stream_close callback gets passed to http2_handle_stream_close. Previously, this might not happen. To achieve this, we increment drain property to forcibly call recv function for that stream. To more accurately check that we have no pending event before shutting down HTTP/2 session, we sum up drain property into http_conn.drain_total. We only shutdown session if that value is 0. With this commit, when stream was closed before reading response header fields, error code CURLE_HTTP2_STREAM is returned even if HTTP/2 level error is NO_ERROR. This signals the upper layer that stream was closed by error just like TCP connection close in HTTP/1. Ref: https://github.com/curl/curl/issues/659 Ref: https://github.com/curl/curl/pull/663
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* http2: Support trailer fieldsTatsuhiro Tsujikawa2015-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit adds trailer support in HTTP/2. In HTTP/1.1, chunked encoding must be used to send trialer fields. HTTP/2 deprecated any trandfer-encoding, including chunked. But trailer fields are now always available. Since trailer fields are relatively rare these days (gRPC uses them extensively though), allocating buffer for trailer fields is done when we detect that HEADERS frame containing trailer fields is started. We use Curl_add_buffer_* functions to buffer all trailers, just like we do for regular header fields. And then deliver them when stream is closed. We have to be careful here so that all data are delivered to upper layer before sending trailers to the application. We can deliver trailer field one by one using NGHTTP2_ERR_PAUSE mechanism, but current method is far more simple. Another possibility is use chunked encoding internally for HTTP/2 traffic. I have not tested it, but it could add another overhead. Closes #564
* http2: discard frames with no SessionHandleAnders Bakken2015-08-111-1/+0
| | | | | | | | | | | | Return 0 instead of NGHTTP2_ERR_CALLBACK_FAILURE if we can't locate the SessionHandle. Apparently mod_h2 will sometimes send a frame for a stream_id we're finished with. Use nghttp2_session_get_stream_user_data and nghttp2_session_set_stream_user_data to identify SessionHandles instead of a hash. Closes #372
* http2: fixed the header accessor functions for the push callbackDaniel Stenberg2015-06-241-1/+4
|
* http2: setup the new pushed stream properlyDaniel Stenberg2015-06-241-0/+1
|
* http: Add some include guards for the new HTTP/2 stuffJay Satiro2015-05-181-0/+4
|
* http2: store upload state per streamDaniel Stenberg2015-05-181-3/+4
| | | | Use a curl_off_t for upload left
* http2: rename s/data/pausedataDaniel Stenberg2015-05-181-2/+2
|
* http2: separate multiplex/pipelining + cleanup memory leaksDaniel Stenberg2015-05-181-0/+1
|
* http2: Don't call nghttp2_session_mem_recv while it is paused by a streamTatsuhiro Tsujikawa2015-05-181-0/+2
|
* http2: Read data left in connection buffer after pauseTatsuhiro Tsujikawa2015-05-181-0/+2
| | | | | | | | Previously when we do pause because of out of buffer, we just throw away unread data in connection buffer. This just broke protocol framing, and I saw occasional FRAME_SIZE_ERROR. This commit fix this issue by remembering how much data read, and in the next iteration, we process remaining data.
* http2: store incoming h2 SETTINGSDaniel Stenberg2015-05-181-0/+8
|
* http2: force "drainage" of streamsDaniel Stenberg2015-05-181-0/+1
| | | | | ... which is necessary since the socket won't be readable but there is data waiting in the buffer.