aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
AgeCommit message (Collapse)Author
2011-10-12OOM handling/cleanup slight adjustmentsYang Tse
2011-10-04ftp: improved the failed PORT host name resolved error messageDaniel Stenberg
2011-09-14ftp.c: add a couple of failure messagesYang Tse
2011-09-12ftp.c: fix socket leak torture tests detected 2011-08-30Yang Tse
Also fix inappropriate error handling when sending ftp EPRT or PORT commands.
2011-09-10ftp.c: fix ftp active connects which got broken with commit fdf157abdfYang Tse
2011-09-07ftp_state_use_port: minor code indent fixDaniel Stenberg
2011-09-05fix bool variables checking and assignmentYang Tse
2011-09-03fix a bunch of MSVC compiler warningsYang Tse
2011-09-01ftp.c: fix some leaks torture tests detected 2011-08-30 - follow-upYang Tse
follow-up for commit d20408e8
2011-08-31ftp.c: fix some leaks torture tests detected 2011-08-30 - follow-upYang Tse
follow-up for commit c06de200
2011-08-31fix some leaks torture tests detected 2011-08-30Yang Tse
2011-08-31fix some leaks torture tests detected 2011-08-30Yang Tse
2011-08-18FTP: fix proxy connect race conditionDaniel Stenberg
When using the multi interface, a SOCKS proxy, and a connection that wouldn't immediately consider itself connected (which my Linux tests do by default), libcurl would be tricked into doing _two_ connects to the SOCKS proxy when it setup the data connection and then of course the second attempt would fail miserably and cause error. This problem is a regression that was introduced by commit 4a42e5cdaa344755 that was introduced in the 7.21.7 release. Bug: http://curl.haxx.se/mail/lib-2011-08/0199.html Reported by: Fabian Keil
2011-08-08ftp_doing: bail out on error properlyDaniel Stenberg
When a failure has been detected we must abort immdiately. Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html Reported by: "Spoon Man"
2011-07-26stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.hYang Tse
2011-07-04code style: space between close paren and open braceDaniel Stenberg
2011-06-04Curl_socket_ready: make timeout a 'long'Daniel Stenberg
It was mostly typecasted to int all over the code so switching to long instead all over should be a net gain.
2011-06-02compiler warning: fixYang Tse
Fix compiler warning: cast increases required alignment
2011-05-18CLOSESOCKETFUNCTION: addedDaniel Stenberg
Introduced the initial setup to allow closesocket callbacks by making sure sclose() is only ever called from one place in the libcurl source and still run all test cases fine.
2011-05-05set_userpass: convert from protocol-specific to genericDaniel Stenberg
The protocol handler's flags field now can set that the protocol requires a password, so that the set_userpass function doesn't have to have the specific knowledge of which protocols that do.
2011-05-05RTSP: convert protocol-specific checks to genericDaniel Stenberg
Add a 'readwrite' function to the protocol handler struct and use that for the extra readwrite functionality RTSP needs.
2011-05-05SSL: check for SSL, not specific protocolsDaniel Stenberg
Code cleanup to check less for protocols and more for the specific relevant feature. Like if SSL is required.
2011-04-28proxy: allow socks:// prefix in proxy stringDaniel Stenberg
Inspired by a patch from OB.Conseil. Added test case 708 to verify.
2011-04-27whitespace cleanup: no space first in conditionalsDaniel Stenberg
"if(a)" is our style, not "if( a )"
2011-04-27source cleanup: unify look, style and indent levelsDaniel Stenberg
By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
2011-04-25async resolvers: further cleanupsDaniel Stenberg
asyn-ares.c and asyn-thread.c are two separate backends that implement the same (internal) async resolver API for libcurl to use. Backend is specified at build time. The internal resolver API is defined in asyn.h for asynch resolvers.
2011-04-21Fix a couple of spelling errors in lib/Fabian Keil
Found with codespell.
2011-04-20CURL_DOES_CONVERSIONS: cleanupDaniel Stenberg
Massively reduce #ifdefs all over (23 #ifdef lines less so far) Moved conversion-specific code to non-ascii.c
2011-04-05return code cleanup: build, init and run-time errorsDaniel Stenberg
Stop the abuse of CURLE_FAILED_INIT as return code for things not being init related by introducing two new return codes: CURLE_NOT_BUILT_IN and CURLE_UNKNOWN_OPTION CURLE_NOT_BUILT_IN replaces return code 4 that has been obsoleted for several years. It is used for returning error when something is attempted to be used but the feature/option was not enabled or explictitly disabled at build-time. Getting this error mostly means that libcurl needs to be rebuilt. CURLE_FAILED_INIT is now saved and used strictly for init failures. Getting this problem means something went seriously wrong, like a resource shortage or similar. CURLE_UNKNOWN_OPTION is the option formerly known as CURLE_UNKNOWN_TELNET_OPTION (and the old name is still present, separately defined to be removed in a very distant future). This error code is meant to be used to return when an option is given to libcurl that isn't known. This problem would mostly indicate a problem in the program that uses libcurl.
2011-04-05FTP+proxy: macrofied functions when proxy disabledDaniel Stenberg
In my attempts to reduce #ifdefs in code, the SOCKS functions are now macros when libcurl is built without proxy support and therefore the FTP code could avoid some #ifs.
2011-04-04http-proxy: move proxy code to http_proxy.cDaniel Stenberg
The new http_proxy.* files now host HTTP proxy specific code (500+ lines moved out from http.c), and as a consequence there is a macro introduced for the Curl_proxyCONNECT() function so that code can use it without actually supporting proxy (or HTTP) in builds.
2011-03-14protocols: use CURLPROTO_ internallyDaniel Stenberg
The PROT_* set of internal defines for the protocols is no longer used. We now use the same bits internally as we have defined in the public header using the CURLPROTO_ prefix. This is for simplicity and because the PROT_* prefix was already used duplicated internally for a set of KRB4 values. The PROTOPT_* defines were moved up to just below the struct definition within which they are used.
2011-03-14protocol handler: added flags fieldDaniel Stenberg
The protocol handler struct got a 'flags' field for special information and characteristics of the given protocol. This now enables us to move away central protocol information such as CLOSEACTION and DUALCHANNEL from single defines in a central place, out to each protocol's definition. It also made us stop abusing the protocol field for other info than the protocol, and we could start cleaning up other protocol-specific things by adding flags bits to set in the handler struct. The "protocol" field connectdata struct was removed as well and the code now refers directly to the conn->handler->protocol field instead. To make things work properly, the code now always store a conn->given pointer that points out the original handler struct so that the code can learn details from the original protocol even if conn->handler is modified along the way - for example when switching to go over a HTTP proxy.
2011-02-07Curl_gmtime: added a portable gmtimeDaniel Stenberg
Instead of polluting many places with #ifdefs, we create a single place for this function, and also check return code properly so that a NULL pointer returned won't cause problems.
2011-01-04Curl_timeleft: s/conn/data in first argumentDaniel Stenberg
As the function doesn't really use the connectdata struct but only the SessionHanadle struct I modified what argument it wants.
2010-12-06url: provide dead_connection flag in Curl_handler::disconnectKamil Dudka
It helps to prevent a hangup with some FTP servers in case idle session timeout has exceeded. But it may be useful also for other protocols that send any quit message on disconnect. Currently used by FTP, POP3, IMAP and SMTP.
2010-12-04fix compiler warning: conversion may lose significant bitsYang Tse
2010-12-02fix compiler warning: statement is not reachableYang Tse
2010-12-01fix compiler warning: conversion may lose significant bitsYang Tse
2010-11-28atoi: remove atoi usageYang Tse
2010-11-26ftp: fix 'bool' data type implementation dependant usageYang Tse
2010-11-13urldata: Capitalize enum protect_level values.Julien Chaffraix
This makes it easier to spot the enum values from the variables. Removed some unneeded DEBUGASSERT added in the previous commit.
2010-11-13security: tighten enum protection_level usage.Julien Chaffraix
While changing Curl_sec_read_msg to accept an enum protection_level instead of an int, I went ahead and fixed the usage of the associated fields. Some code was assuming that prot_clear == 0. Fixed those to use the proper value. Added assertions prior to any code that would set the protection level.
2010-11-09ftp: treat server's response 421 as CURLE_OPERATION_TIMEDOUTKamil Dudka
Bug: https://bugzilla.redhat.com/650255 Reported by: Simon H.
2010-11-08ftp: close connection as soon as ABOR has been sentKamil Dudka
... and do not send ABOR unless really necessary. Bug: https://bugzilla.redhat.com/649347 Reported by: Simon H.
2010-10-29ftp: prevent server from hanging on closed data connectionKamil Dudka
Some FTP servers (e.g. Pure-ftpd) end up hanging if we close the data connection before transferring all the requested data. If we send ABOR in that case, it prevents the server from hanging. Bug: https://bugzilla.redhat.com/643656 Reported by: Pasi Karkkainen, Patrick Monnerat
2010-10-20Lightened the stack in wc_statemach to permit deeper recursionDan Fandrich
Also, added a few hints to help compilers to perform tail call recursion optimization.
2010-10-02krb5-gssapi: Delete the GSS-API context.Julien Chaffraix
This fixes a memory leak related to the GSS-API code. Added a krb5_init and krb5_end functions. Also removed a work-around the lack of proper initialization of the GSS-API context.
2010-09-28security.c: Remove Curl_sec_fflush_fd.Julien Chaffraix
The current implementation would make us send wrong data on a closed socket. We don't buffer our data so the method can be safely removed.
2010-09-28security.c: Fix Curl_sec_login after rewrite.Julien Chaffraix
Curl_sec_login was returning the opposite result that the code in ftp.c was expecting. Simplified the return code (using a CURLcode) so to see more clearly what is going on.