[MPlayer-dev-eng] [PATCH 4/7] stream ftp: Only send QUIT command if connected

Alexander Strasser eclipse7 at gmx.net
Sun Nov 11 22:01:22 CET 2012


Do not attempt to send commands without control connections.

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---
 stream/stream_ftp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/stream/stream_ftp.c b/stream/stream_ftp.c
index a24117c..e136da8 100644
--- a/stream/stream_ftp.c
+++ b/stream/stream_ftp.c
@@ -401,9 +401,11 @@ static void close_f(stream_t *s) {
     s->fd = 0;
   }
 
-  FtpSendCmd("QUIT",p,NULL);
+  if (p->handle) {
+    FtpSendCmd("QUIT", p, NULL);
+    closesocket(p->handle);
+  }
 
-  if(p->handle) closesocket(p->handle);
   free(p->buf);
 
   m_struct_free(&stream_opts,p);
-- 
1.7.10.2.552.gaa3bb87


More information about the MPlayer-dev-eng mailing list