changeset 7250:27a1315d6af4

Checked if the connection succeeded before writing in the socket.
author bertrand
date Tue, 03 Sep 2002 01:25:31 +0000
parents 06a8e6a01180
children cc83ad6af513
files libmpdemux/asf_mmst_streaming.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/asf_mmst_streaming.c	Tue Sep 03 00:18:08 2002 +0000
+++ b/libmpdemux/asf_mmst_streaming.c	Tue Sep 03 01:25:31 2002 +0000
@@ -513,11 +513,19 @@
   URL_t *url1 = stream->streaming_ctrl->url;
   int s = stream->fd;
 
+  if( s>0 ) {
+	  close( stream->fd );
+	  stream->fd = -1;
+  }
+  
   /* parse url */
   path = strchr(url1->file,'/') + 1;
 
   url1->port=1755;
   s = connect2Server( url1->hostname, url1->port );
+  if( s<0 ) {
+	  return s;
+  }
   printf ("connected\n");
 
   /*