[rtmpdump] r382 - trunk/rtmpsuck.c

hyc subversion at mplayerhq.hu
Mon Mar 22 04:38:15 CET 2010


Author: hyc
Date: Mon Mar 22 04:38:13 2010
New Revision: 382

Log:
Check for valid socket before setting in fdset

Modified:
   trunk/rtmpsuck.c

Modified: trunk/rtmpsuck.c
==============================================================================
--- trunk/rtmpsuck.c	Mon Mar 22 01:40:34 2010	(r381)
+++ trunk/rtmpsuck.c	Mon Mar 22 04:38:13 2010	(r382)
@@ -803,9 +803,11 @@ void doServe(STREAMING_SERVER * server,	
 	      RTMP_Log(RTMP_LOGERROR, "Request timeout/select failed, ignoring request");
 	      goto cleanup;
 	    }
-          if (FD_ISSET(server->rs.m_sb.sb_socket, &rfds))
+          if (server->rs.m_sb.sb_socket > 0 &&
+	    FD_ISSET(server->rs.m_sb.sb_socket, &rfds))
             sr = 1;
-          if (FD_ISSET(server->rc.m_sb.sb_socket, &rfds))
+          if (server->rc.m_sb.sb_socket > 0 &&
+	    FD_ISSET(server->rc.m_sb.sb_socket, &rfds))
             cr = 1;
         }
       if (sr)


More information about the rtmpdump mailing list