diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-05-19 20:54:31 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-05-19 20:54:31 +0000 |
commit | de7a14003c0ef455e074cc9629bf9faae3474a7e (patch) | |
tree | 3b4dbff5ff7a6acc5df9e8692a3ed6ff58e562be /lib | |
parent | e3ead9f58565b5216610da4c3e699676013218b4 (diff) |
- Kamil Dudka brought the patch from the Redhat bug entry
https://bugzilla.redhat.com/show_bug.cgi?id=427966 which was libcurl closing
a bad file descriptor when closing down the FTP data connection. Caolan
McNamara seems to be the original author of it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3251,9 +3251,10 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, /* Note that we keep "use" set to TRUE since that (next) connection is still requested to use SSL */ } - sclose(conn->sock[SECONDARYSOCKET]); - - conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; + if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) { + sclose(conn->sock[SECONDARYSOCKET]); + conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; + } } if((ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid && |