aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-07-29 12:54:05 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-07-29 12:54:05 +0000
commitf1fa7b8ba469d9b8681e30f107b44004695b32e9 (patch)
tree80542fd7f33b8d77ecb6f66ae13d9f3e32ed2cc9 /lib/ftp.c
parent86ff3194fa902e131c7a105a329202058327dcc7 (diff)
Bug report #1759542 (http://curl.haxx.se/bug/view.cgi?id=1759542). A bad use
of a socket after it has been closed, when the FTP-SSL data connection is taken down.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 21d29b446..4df17decb 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3115,6 +3115,14 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status, bool premature
shutdown(conn->sock[SECONDARYSOCKET],2); /* SD_BOTH */
#endif
+ if(conn->ssl[SECONDARYSOCKET].use) {
+ /* The secondary socket is using SSL so we must close down that part first
+ before we close the socket for real */
+ Curl_ssl_close(conn, SECONDARYSOCKET);
+
+ /* 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;