summaryrefslogtreecommitdiff
path: root/lib/transfer.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* TODO fixed: Detect when called from within callbacksBjörn Stenberg2018-02-151-0/+6
| | | | Closes #2302
* HTTP: support multiple Content-EncodingsPatrick Monnerat2017-11-051-33/+4
| | | | | | | | | | This is implemented as an output streaming stack of unencoders, the last calling the client write procedure. New test 230 checks this feature. Bug: https://github.com/curl/curl/pull/2002 Reported-By: Daniel Bankhead
* transfer: Fix chunked-encoding upload bugJay Satiro2017-10-261-2/+5
| | | | | | | | | | | | | | | | | | | | - When uploading via chunked-encoding don't compare file size to bytes sent to determine whether the upload has finished. Chunked-encoding adds its own overhead which why the bytes sent is not equal to the file size. Prior to this change if a file was uploaded in chunked-encoding and its size was known it was possible that the upload could end prematurely without sending the final few chunks. That would result in a server hang waiting for the remaining data, likely followed by a disconnect. The scope of this bug is limited to some arbitrary file sizes which have not been determined. One size that triggers the bug is 475020. Bug: https://github.com/curl/curl/issues/2001 Reported-by: moohoorama@users.noreply.github.com Closes https://github.com/curl/curl/pull/2010
* wildcards: don't use with non-supported protocolsMax Dymond2017-10-261-1/+2
| | | | | | Fixes timeouts in the fuzzing tests for non-FTP protocols. Closes #2016
* time: rename Curl_tvnow to Curl_nowDaniel Stenberg2017-10-251-4/+4
| | | | | | | | | | ... since the 'tv' stood for timeval and this function does not return a timeval struct anymore. Also, cleaned up the Curl_timediff*() functions to avoid typecasts and clean up the descriptive comments. Closes #2011
* timediff: return timediff_t from the time diff functionsDaniel Stenberg2017-10-251-4/+5
| | | | | | | | | | | | | | | ... to cater for systems with unsigned time_t variables. - Renamed the functions to curlx_timediff and Curl_timediff_us. - Added overflow protection for both of them in either direction for both 32 bit and 64 bit time_ts - Reprefixed the curlx_time functions to use Curl_* Reported-by: Peter Piekarski Fixes #2004 Closes #2005
* conversions: fix several compiler warningsDaniel Stenberg2017-09-151-13/+14
|
* code style: remove wrong uses of multiple spacesDaniel Stenberg2017-09-121-1/+1
| | | | Closes #1878
* code style: use spaces around plusesDaniel Stenberg2017-09-111-3/+3
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-27/+27
|
* Curl_checkheaders: make it available for IMAP and SMTP tooDaniel Stenberg2017-09-111-0/+25
| | | | | | ... not only HTTP uses this now. Closes #1875
* mime: unified to use the typedef'd mime structs everywhereDaniel Stenberg2017-09-051-1/+1
| | | | ... and slightly edited to follow our code style better.
* mime: new MIME API.Patrick Monnerat2017-09-021-4/+20
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* progress: Track total times following redirectsRyan Winograd2017-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Update the progress timers `t_nslookup`, `t_connect`, `t_appconnect`, `t_pretransfer`, and `t_starttransfer` to track the total times for these activities when a redirect is followed. Previously, only the times for the most recent request would be tracked. Related changes: - Rename `Curl_pgrsResetTimesSizes` to `Curl_pgrsResetTransferSizes` now that the function only resets transfer sizes and no longer modifies any of the progress timers. - Add a bool to the `Progress` struct that is used to prevent double-counting `t_starttransfer` times. Added test case 1399. Fixes #522 and Known Bug 1.8 Closes #1602 Reported-by: joshhe on github