summaryrefslogtreecommitdiff
path: root/lib/ftp.c
Commit message (Collapse)AuthorAgeFilesLines
* code style: remove wrong uses of multiple spacesDaniel Stenberg2017-09-121-1/+1
| | | | Closes #1878
* code style: use spaces around plusesDaniel Stenberg2017-09-111-6/+6
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-56/+55
|
* ftp: fix CWD when doing multicwd then nocwd on same connectionDaniel Stenberg2017-08-171-1/+3
| | | | | | Fixes #1782 Closes #1787 Reported-by: Peter Lamare
* strtoofft: reduce integer overflow risks globallyDaniel Stenberg2017-08-141-15/+18
| | | | | | | ... make sure we bail out on overflows. Reported-by: Brian Carpenter Closes #1758
* FTP: skip unnecessary CWD when in nocwd modeDaniel Stenberg2017-08-041-10/+13
| | | | | | ... when reusing a connection. If it didn't do any CWD previously. Fixes #1718
* timeval: struct curltime is a struct timeval replacementDaniel Stenberg2017-07-281-1/+1
| | | | | | | | | ... to make all libcurl internals able to use the same data types for the struct members. The timeval struct differs subtly on several platforms so it makes it cumbersome to use everywhere. Ref: #1652 Closes #1693
* 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.
* http-proxy: only attempt FTP over HTTP proxyDaniel Stenberg2017-06-151-77/+2
| | | | | | | | | | ... all other non-HTTP protocol schemes are now defaulting to "tunnel trough" mode if a HTTP proxy is specified. In reality there are no HTTP proxies out there that allow those other schemes. Assisted-by: Ray Satiro, Michael Kaufmann Closes #1505
* http-proxy: do the HTTP CONNECT process entirely non-blockingDaniel Stenberg2017-06-141-3/+2
| | | | | | | Mentioned as a problem since 2007 (8f87c15bdac63) and of course it existed even before that. Closes #1547
* multi: assign IDs to all timers and make each timer singletonDaniel Stenberg2017-05-101-4/+2
| | | | | | | 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
* buffer: use data->set.buffer_size instead of BUFSIZEDaniel Stenberg2017-05-011-2/+3
| | | | ... to properly use the dynamically set buffer size!
* buffer_size: make sure it always has the correct sizeDaniel Stenberg2017-05-011-1/+1
| | | | Removes the need for CURL_BUFSIZE
* ftp: use private buffer for temp storage, not receive bufferDaniel Stenberg2017-05-011-10/+12
|
* http-proxy: remove unused argument from Curl_proxyCONNECT()Daniel Stenberg2017-04-261-1/+1
|
* llist: replace Curl_llist_alloc with Curl_llist_initDaniel Stenberg2017-04-041-7/+8
| | | | | | | | No longer allocate the curl_llist head struct for lists separately. Removes 17 (15%) tiny allocations in a normal "curl localhost" invoke. closes #1381
* spelling fixesklemens2017-03-261-5/+5
| | | | Closes #1356
* Improve code readbilitySylvestre Ledru2017-03-131-41/+32
| | | | | | ... by removing the else branch after a return, break or continue. Closes #1310
* build: fix gcc7 implicit fallthrough warningsAlexis La Goutte2017-03-031-0/+1
| | | | | | | Mark intended fallthroughs with /* FALLTHROUGH */ so that gcc will know it's expected and won't warn on [-Wimplicit-fallthrough=]. Closes https://github.com/curl/curl/pull/1297
* ftp: fixed a NULL pointer dereference on OOMDan Fandrich2017-02-251-2/+5
|
* ftp: removed an erroneous free in an OOM pathDan Fandrich2017-02-251-1/+0
|
* CURLOPT_BUFFERSIZE: support enlarging receive bufferRichy Kim2017-01-191-3/+4
| | | | | | | | | | Replace use of fixed macro BUFSIZE to define the size of the receive buffer. Reappropriate CURLOPT_BUFFERSIZE to include enlarging receive buffer size. Upon setting, resize buffer if larger than the current default size up to a MAX_BUFSIZE (512KB). This can benefit protocols like SFTP. Closes #1222
* ftp: failure to resolve proxy should return that error codeDaniel Stenberg2016-12-251-1/+1
|
* http_proxy: Fix proxy CONNECT hang on pending dataJay Satiro2016-12-191-1/+1
| | | | | | | - Check for pending data before waiting on the socket. Bug: https://github.com/curl/curl/issues/1156 Reported-by: Adam Langley
* checksrc: warn for assignments within if() expressionsDaniel Stenberg2016-12-141-19/+25
| | | | | ... they're already frowned upon in our source code style guide, this now enforces the rule harder.
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-4/+4
| | | | In order to make the code style more uniform everywhere
* proxy: Support HTTPS proxy and SOCKS+HTTP(s)Alex Rousskov2016-11-241-97/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * HTTPS proxies: An HTTPS proxy receives all transactions over an SSL/TLS connection. Once a secure connection with the proxy is established, the user agent uses the proxy as usual, including sending CONNECT requests to instruct the proxy to establish a [usually secure] TCP tunnel with an origin server. HTTPS proxies protect nearly all aspects of user-proxy communications as opposed to HTTP proxies that receive all requests (including CONNECT requests) in vulnerable clear text. With HTTPS proxies, it is possible to have two concurrent _nested_ SSL/TLS sessions: the "outer" one between the user agent and the proxy and the "inner" one between the user agent and the origin server (through the proxy). This change adds supports for such nested sessions as well. A secure connection with a proxy requires its own set of the usual SSL options (their actual descriptions differ and need polishing, see TODO): --proxy-cacert FILE CA certificate to verify peer against --proxy-capath DIR CA directory to verify peer against --proxy-cert CERT[:PASSWD] Client certificate file and password --proxy-cert-type TYPE Certificate file type (DER/PEM/ENG) --proxy-ciphers LIST SSL ciphers to use --proxy-crlfile FILE Get a CRL list in PEM format from the file --proxy-insecure Allow connections to proxies with bad certs --proxy-key KEY Private key file name --proxy-key-type TYPE Private key file type (DER/PEM/ENG) --proxy-pass PASS Pass phrase for the private key --proxy-ssl-allow-beast Allow security flaw to improve interop --proxy-sslv2 Use SSLv2 --proxy-sslv3 Use SSLv3 --proxy-tlsv1 Use TLSv1 --proxy-tlsuser USER TLS username --proxy-tlspassword STRING TLS password --proxy-tlsauthtype STRING TLS authentication type (default SRP) All --proxy-foo options are independent from their --foo counterparts, except --proxy-crlfile which defaults to --crlfile and --proxy-capath which defaults to --capath. Curl now also supports %{proxy_ssl_verify_result} --write-out variable, similar to the existing %{ssl_verify_result} variable. Supported backends: OpenSSL, GnuTLS, and NSS. * A SOCKS proxy + HTTP/HTTPS proxy combination: If both --socks* and --proxy options are given, Curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. TODO: Update documentation for the new APIs and --proxy-* options. Look for "Added in 7.XXX" marks.
* lib: fix compiler warnings after de4de4e3c7cMarcel Raad2016-11-181-8/+8
| | | | | | | | | Visual C++ now complains about implicitly casting time_t (64-bit) to long (32-bit). Fix this by changing some variables from long to time_t, or explicitly casting to long where the public interface would be affected. Closes #1131
* ftp_done: don't clobber the passed in error codeDaniel Stenberg2016-11-021-4/+5
| | | | Coverity CID 1374359 pointed out the unused result value.
* ftp: remove dead code in ftp_doneDaniel Stenberg2016-11-021-2/+0
| | | | Coverity CID 1374358
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-1/+1
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-3/+3
| | | | | | | ... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
* ftp: check for previous patch must be case sensitive!Daniel Stenberg2016-10-311-1/+1
| | | | | ... otherwise example.com/PATH and example.com/path would be assumed to be the same and they usually aren't!
* escape: avoid using curl_easy_unescape() internallyDaniel Stenberg2016-10-311-31/+29
| | | | Since the internal Curl_urldecode() function has a better API.
* select: switch to macros in uppercaseDaniel Stenberg2016-10-181-2/+2
| | | | | | | | | | Curl_select_ready() was the former API that was replaced with Curl_select_check() a while back and the former arg setup was provided with a define (in order to leave existing code unmodified). Now we instead offer SOCKET_READABLE and SOCKET_WRITABLE for the most common shortcuts where only one socket is checked. They're also more visibly macros.
* ftp: fix Curl_ftpsendf()Daniel Stenberg2016-10-081-6/+4
| | | | | | | | | | | ... it no longer takes printf() arguments since it was only really taken advantage by one user and it was not written and used in a safe way. Thus the 'f' is removed from the function name and the proto is changed. Although the current code wouldn't end up in badness, it was a risk that future changes could end up springf()ing too large data or passing in a format string inadvertently.
* errors: new alias CURLE_WEIRD_SERVER_REPLY (8)Jay Satiro2016-09-071-3/+3
| | | | | | | | Since we're using CURLE_FTP_WEIRD_SERVER_REPLY in imap, pop3 and smtp as more of a generic "failed to parse" introduce an alias without FTP in the name. Closes https://github.com/curl/curl/pull/975
* ftp_done: remove dead codeDaniel Stenberg2016-08-261-4/+2
|
* ftp: fix wrong poll on the secondary socketAles Novak2016-08-231-1/+1
| | | | | | | | | | | | | | | When we're uploading using FTP and the server issues a tiny pause between opening the connection to the client's secondary socket, the client's initial poll() times out, which leads to second poll() which does not wait for POLLIN on the secondary socket. So that poll() also has to time out, creating a long (200ms) pause. This patch adds the correct flag to the secondary socket, making the second poll() correctly wait for the connection there too. Signed-off-by: Ales Novak <alnovak@suse.cz> Closes #978
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-33/+33
|
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-2/+1
| | | | | | | | | | | | | | | | | | | | 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
* code: style updatesDaniel Stenberg2016-04-031-12/+12
|
* multi: turn Curl_done into file local multi_doneDaniel Stenberg2016-03-301-6/+1
| | | | ... as it now is used by multi.c only.
* ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabledSteve Holme2016-03-191-2/+3
| | | | warning C4706: assignment within conditional expression
* ftp: remove a check for NULL(!)Daniel Stenberg2016-03-101-6/+7
| | | | | | ... as it implies we need to check for that on all the other variable references as well (as Coverity otherwise warns us for missing NULL checks), and we're alredy making sure that the pointer is never NULL.
* ftp_done: clear tunnel_state when secondary socket closesDaniel Stenberg2016-03-081-15/+15
| | | | | | | | Introducing a function for closing the secondary connection to make this bug less likely to happen again. Reported-by: daboul Closes #701
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* Revert "cleanup: general removal of TODO (and similar) comments"Daniel Stenberg2015-11-241-1/+1
| | | | | | | This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a. Feedback-by: Dan Fandrich URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
* cleanup: general removal of TODO (and similar) commentsDaniel Stenberg2015-11-131-1/+1
| | | | | | They tend to never get updated anyway so they're frequently inaccurate and we never go back to revisit them anyway. We document issues to work on properly in KNOWN_BUGS and TODO instead.
* ftp: allow CURLOPT_IGNORE_CONTENT_LENGTH to ignore sizeKurt Fankhauser2015-10-231-2/+14
| | | | | | | This allows FTP transfers with growing (or shrinking) files without causing a transfer error. Closes #480