aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-09-10 05:05:27 +0200
committerYang Tse <yangsita@gmail.com>2011-09-10 05:05:27 +0200
commit72c14bd6f08f2f0fb8bfe54c128aacbd4a4072d3 (patch)
treea37c93e318e5e5404e5f5a82191da1ba27a59b69 /lib/ftp.c
parent0413e248911cb16c6587f06ae6bdadbc4531d690 (diff)
ftp.c: fix ftp active connects which got broken with commit fdf157abdf
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 20b70ce3e..8bbd585e5 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -965,13 +965,6 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
conn->bits.ftp_use_eprt = TRUE;
#endif
- /* we set the secondary socket variable to this for now, it is only so that
- the cleanup function will close it in case we fail before the true
- secondary stuff is made */
- if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET])
- Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]);
- conn->sock[SECONDARYSOCKET] = portsock;
-
for(; fcmd != DONE; fcmd++) {
if(!conn->bits.ftp_use_eprt && (EPRT == fcmd))
@@ -1037,6 +1030,13 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
/* store which command was sent */
ftpc->count1 = fcmd;
+ /* we set the secondary socket variable to this for now, it is only so that
+ the cleanup function will close it in case we fail before the true
+ secondary stuff is made */
+ if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET])
+ Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]);
+ conn->sock[SECONDARYSOCKET] = portsock;
+
/* this tcpconnect assignment below is a hackish work-around to make the
multi interface with active FTP work - as it will not wait for a
(passive) connect in Curl_is_connected().