aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-05-19 20:54:31 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-05-19 20:54:31 +0000
commitde7a14003c0ef455e074cc9629bf9faae3474a7e (patch)
tree3b4dbff5ff7a6acc5df9e8692a3ed6ff58e562be /lib
parente3ead9f58565b5216610da4c3e699676013218b4 (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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index ebd04f954..0bd07710d 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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 &&