changeset 21565:546cf4a6377a

Make sure stream->fd is set correct (esp. to -1 on error when fd is closed)
author reimar
date Sun, 10 Dec 2006 19:35:39 +0000
parents 6ed90ece4b9b
children 79d969f9eec0
files stream/http.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/http.c	Sun Dec 10 19:25:59 2006 +0000
+++ b/stream/http.c	Sun Dec 10 19:35:39 2006 +0000
@@ -744,7 +744,6 @@
 			goto err_out;
 		}
 
-		stream->fd=fd;
 		if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
 			http_debug_hdr( http_hdr );
 		}
@@ -857,9 +856,11 @@
 
 err_out:
 	if (fd > 0) closesocket( fd );
+	fd = -1;
 	res = -1;
 	http_free( http_hdr );
 out:
+	stream->fd = fd;
 	return res;
 }