summaryrefslogtreecommitdiff
path: root/lib/transfer.c
Commit message (Collapse)AuthorAgeFilesLines
...
* quiche: first working HTTP/3 requestDaniel Stenberg2019-08-061-1/+1
| | | | | | | | | - enable debug log - fix use of quiche API - use download buffer - separate header/body Closes #4193
* cleanup: remove the 'numsocks' argument used in many placesDaniel Stenberg2019-07-301-8/+2
| | | | | | | | | It was used (intended) to pass in the size of the 'socks' array that is also passed to these functions, but was rarely actually checked/used and the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries that should be used instead. Closes #4169
* readwrite_data: repair setting the TIMER_STARTTRANSFER stampDaniel Stenberg2019-07-301-1/+1
| | | | | | | | | | Regression, broken in commit 65eb65fde64bd5f (curl 7.64.1) Reported-by: Jonathan Cardoso Machado Assisted-by: Jay Satiro Fixes #4136 Closes #4162
* lib: Use UTF-8 encoding in commentsGergely Nagy2019-07-061-1/+1
| | | | | | | | | | Some editors and IDEs assume that source files use UTF-8 file encodings. It also fixes the build with MSVC when /utf-8 command line option is used (this option is mandatory for some other open-source projects, this is useful when using the same options is desired for building all libraries of a project). Closes https://github.com/curl/curl/pull/4087
* http2: call done_sending on end of uploadDaniel Stenberg2019-06-241-4/+4
| | | | | | | | | To make sure a HTTP/2 stream registers the end of stream. Bug #4043 made me find this problem but this fix doesn't correct the reported issue. Closes #4068
* lib: reduce variable scopesMarcel Raad2019-05-201-8/+6
| | | | | | Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872
* cleanup: remove FIXME and TODO commentsDaniel Stenberg2019-05-161-1/+0
| | | | | | | | | They serve very little purpose and mostly just add noise. Most of them have been around for a very long time. I read them all before removing or rephrasing them. Ref: #3876 Closes #3883
* wildcard: disable from build when FTP isn't presentDaniel Stenberg2019-05-131-0/+2
|
* pipelining: removedDaniel Stenberg2019-04-061-72/+13
| | | | | | | As previously planned and documented in DEPRECATE.md, all pipelining code is removed. Closes #3651
* transfer: fix LGTM alert "Comparison is always true"Marcel Raad2019-04-051-1/+1
| | | | | | | Just remove the redundant condition, which also makes it clear that k->buf is always 0-terminated if this break is not hit. Closes https://github.com/curl/curl/pull/3732
* urldata: simplify bytecountersDaniel Stenberg2019-03-011-21/+7
| | | | | | | | | | | | | - 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
* transfer.c: do not compute length of undefined hex buffer.Patrick Monnerat2019-02-141-8/+10
| | | | | | | | | On non-ascii platforms, the chunked hex header was measured for char code conversion length, even for chunked trailers that do not have an hex header. In addition, the efective length is already known: use it. Since the hex length can be zero, only convert if needed. Reported by valgrind.
* pretransfer: don't strlen() POSTFIELDS set for GET requestsDaniel Stenberg2019-02-121-1/+4
| | | | | | | | ... since that data won't be used in the request anyway. Fixes #3548 Reported-by: Renaud Allard Close #3549
* multi: set the EXPIRE_*TIMEOUT timers at TIMER_STARTSINGLE timeDaniel Stenberg2019-02-011-6/+0
| | | | | | | | | To make sure Curl_timeleft() also thinks the timeout has been reached when one of the EXPIRE_*TIMEOUTs expires. Bug: https://curl.haxx.se/mail/lib-2019-01/0073.html Reported-by: Zhao Yisha Closes #3501
* printf: introduce CURL_FORMAT_TIMEDIFF_TRikard Falkeborn2019-01-041-4/+4
|
* printf: fix format specifiersRikard Falkeborn2019-01-041-2/+2
| | | | Closes #3426
* http: Implement trailing headers for chunked transfersAyoub Boudhar2018-12-141-21/+147
| | | | | | | | | | | | | 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
* Curl_follow: extract the Location: header field unvalidatedDaniel Stenberg2018-12-121-5/+15
| | | | | | | | | | | ... when not actually following the redirect. Otherwise we return error for this and an application can't extract the value. Test 1518 added to verify. Reported-by: Pavel Pavlov Fixes #3340 Closes #3364
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-2/+2
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* setopt: add CURLOPT_CURLUJim Fuller2018-11-091-1/+14
| | | | | | Allows an application to pass in a pre-parsed URL via a URL handle. Closes #3227
* libcurl: stop reading from paused transfersSangamkar2018-11-061-0/+5
| | | | | | | In the transfer loop it would previously not acknwledge the pause bit and continue until drained or loop ended. Closes #3240
* Curl_follow: accept non-supported schemes for "fake" redirectsDaniel Stenberg2018-11-021-1/+2
| | | | | | | | | | When not actually following the redirect and the target URL is only stored for later retrieval, curl always accepted "non-supported" schemes. This was a regression from 46e164069d1a5230. Reported-by: Brad King Fixes #3210 Closes #3215
* Fix for compiling with lwIP (3)Gisle Vanem2018-10-231-1/+1
| | | | lwIP on Windows does not have a WSAIoctl() function. But it do have a SO_SNDBUF option to lwip_setsockopt(). But it currently does nothing.
* Curl_follow: return better errors on URL problemsDaniel Stenberg2018-10-231-4/+2
| | | | | | ... by making the converter function global and accessible. Closes #3153
* Curl_follow: remove remaining free(newurl)Daniel Stenberg2018-10-231-3/+1
| | | | | | | | | Follow-up to 05564e750e8f0c. This function no longer frees the passed-in URL. Reported-by: Michael Kaufmann Bug: https://github.com/curl/curl/commit/05564e750e8f0c79016c680f301ce251e6e86155#commitcomm ent-30985666
* multi: avoid double-freeDaniel Stenberg2018-10-191-1/+2
| | | | | | | | | | | Curl_follow() no longer frees the string. Make sure it happens in the caller function, like we normally handle allocations. This bug was introduced with the use of the URL API internally, it has never been in a release version Reported-by: Dario Weißer Closes #3149
* Curl_follow: Always free the passed new URLMichael Kaufmann2018-10-131-1/+3
| | | | Closes #3124
* transfer: fix typo in commentDaniel Gustafsson2018-10-101-1/+1
|
* Curl_retry_request: fix memory leakDaniel Stenberg2018-09-241-2/+7
| | | | | | | Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10648 Closes #3042
* url: use the URL API internally as wellDaniel Stenberg2018-09-221-29/+16
| | | | | | ... to make it a truly unified URL parser. Closes #3017
* URL-APIDaniel Stenberg2018-09-081-309/+5
| | | | | | | See header file and man pages for API. All documented API details work and are tested in the 1560 test case. Closes #2842
* CURLOPT_UPLOAD_BUFFERSIZE: set upload buffer sizeDaniel Stenberg2018-09-061-2/+3
| | | | | | | This is step 3 of #2888. Fixes #2888 Closes #2896
* all: s/int/size_t cleanupDaniel Stenberg2018-09-011-13/+12
| | | | | | Assisted-by: Rikard Falkeborn Closes #2922
* curl-compilers: enable -Wimplicit-fallthrough=4 for GCCMarcel Raad2018-08-211-2/+2
| | | | | | | | This enables level 4 instead of the default level 3, which of the currently used comments only allows /* FALLTHROUGH */ to silence the warning. Closes https://github.com/curl/curl/pull/2747
* upload: change default UPLOAD_BUFSIZE to 64KBDaniel Stenberg2018-08-181-1/+1
| | | | | | | To make uploads significantly faster in some circumstances. Part 2 of #2888 Closes #2892
* upload: allocate upload buffer on-demandDaniel Stenberg2018-08-181-2/+18
| | | | | | | Saves 16KB on the easy handle for operations that don't need that buffer. Part 1 of #2888
* windows: follow up to the buffer-tuning 1ba1dba7Daniel Stenberg2018-08-081-1/+5
| | | | | | | Somehow I didn't include the amended version of the previous fix. This is the missing piece. Pointed-out-by: Viktor Szakats
* windows: implement send buffer tuningDaniel Jelinski2018-08-081-1/+18
| | | | | | | | Significantly enhances upload performance on modern Windows versions. Bug: https://curl.haxx.se/mail/lib-2018-07/0080.html Closes #2762 Fixes #2224
* HTTP: Don't attempt to needlessly decompress redirect bodyHarry Sintonen2018-07-311-1/+1
| | | | | | | | | | | | This change fixes a regression where redirect body would needlessly be decompressed even though it was to be ignored anyway. As it happens this causes secondary issues since there appears to be a bug in apache2 that it in certain conditions generates a corrupt zlib response. The regression was created by commit: dbcced8e32b50c068ac297106f0502ee200a1ebd Discovered-by: Harry Sintonen Closes #2798
* Curl_debug: remove dead printhost codeDaniel Stenberg2018-06-121-4/+4
| | | | | | | | | The struct field is never set (since 5e0d9aea3) so remove the use of it and remove the connectdata pointer from the prototype. Reported-by: Tejas Bug: https://curl.haxx.se/mail/lib-2018-06/0054.html Closes #2647
* cppcheck: fix warningsMarian Klymov2018-06-111-1/+1
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* setup_transfer: deal with both sockets being -1Daniel Stenberg2018-05-111-1/+2
| | | | | Detected by Coverity; CID 1435559. Follow-up to f8d608f38d00. It would index the array with -1 if neither index was a socket.
* transfer: don't unset writesockfd on setup of multiplexed connsDaniel Stenberg2018-05-041-6/+13
| | | | | | | | Curl_setup_transfer() can be called to setup a new individual transfer over a multiplexed connection so it shouldn't unset writesockfd. Bug: #2520 Closes #2549
* URL: fix ASCII dependency in strcpy_url and strlen_urlStephan Mühlstrasser2018-05-031-2/+12
| | | | | | | | | | | | | | Commit 3c630f9b0af097663a64e5c875c580aa9808a92b partially reverted the changes from commit dd7521bcc1b7a6fcb53c31f9bd1192fcc884bd56 because of the problem that strcpy_url() was modified unilaterally without also modifying strlen_url(). As a consequence strcpy_url() was again depending on ASCII encoding. This change fixes strlen_url() and strcpy_url() in parallel to use a common host-encoding independent criterion for deciding whether an URL character must be %-escaped. Closes #2535
* strcpy_url: only %-encode values >= 0x80Daniel Stenberg2018-04-251-1/+1
| | | | | | | | OSS-Fuzz detected https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8000 Broke in dd7521bcc1b7
* ctype: restore character classification for non-ASCII platformsStephan Mühlstrasser2018-04-241-1/+1
| | | | | | | | | | | With commit 4272a0b0fc49a1ac0ceab5c4a365c9f6ab8bf8e2 curl-speficic character classification macros and functions were introduced in curl_ctype.[ch] to avoid dependencies on the locale. This broke curl on non-ASCII, e.g. EBCDIC platforms. This change restores the previous set of character classification macros when CURL_DOES_CONVERSIONS is defined. Closes #2494
* http2: handle GOAWAY properlyDaniel Stenberg2018-04-201-2/+15
| | | | | | | | | | When receiving REFUSED_STREAM, mark the connection for close and retry streams accordingly on another/fresh connection. Reported-by: Terry Wu Fixes #2416 Fixes #1618 Closes #2510
* transfer: make HTTP without headers count correct body sizeDaniel Stenberg2018-03-151-1/+1
| | | | | | | | This is what "HTTP/0.9" basically looks like. Reported on IRC Closes #2382
* readwrite: make sure excess reads don't go beyond buffer endDaniel Stenberg2018-03-121-2/+7
| | | | | | | CVE-2018-1000122 Bug: https://curl.haxx.se/docs/adv_2018-b047.html Detected by OSS-fuzz
* HTTP: allow "header;" to replace an internal header with a blank oneDaniel Stenberg2018-03-111-3/+4
| | | | | | Reported-by: Michael Kaufmann Fixes #2357 Closes #2362