changeset 35337:6641819c8f45

stream ftp: Only send QUIT command if connected Do not attempt to send commands without control connections.
author al
date Tue, 20 Nov 2012 22:20:52 +0000
parents 9c334690f765
children 4fe8922d6242
files stream/stream_ftp.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_ftp.c	Tue Nov 20 22:19:45 2012 +0000
+++ b/stream/stream_ftp.c	Tue Nov 20 22:20:52 2012 +0000
@@ -400,9 +400,11 @@
     s->fd = -1;
   }
 
-  FtpSendCmd("QUIT",p,NULL);
+  if (p->handle >= 0) {
+    FtpSendCmd("QUIT", p, NULL);
+    closesocket(p->handle);
+  }
 
-  if(p->handle >= 0) closesocket(p->handle);
   free(p->buf);
 
   m_struct_free(&stream_opts,p);