[MPlayer-dev-eng] [PATCHv2 5/8] stream ftp: Only send QUIT command if connected

Alexander Strasser eclipse7 at gmx.net
Sat Nov 17 01:02:36 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 3aa3b09..6d0bbbd 100644
--- a/stream/stream_ftp.c
+++ b/stream/stream_ftp.c
@@ -402,9 +402,11 @@ static void close_f(stream_t *s) {
     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);
-- 
1.7.10.2.552.gaa3bb87


More information about the MPlayer-dev-eng mailing list