[Freeswitch-svn] [commit] r13123 - freeswitch/trunk/libs/iksemel/src

FreeSWITCH SVN anthm at freeswitch.org
Wed Apr 22 14:43:53 PDT 2009


Author: anthm
Date: Wed Apr 22 16:43:53 2009
New Revision: 13123

Log:
let return 0 be a failure on read in iks to avoid cpu race

Modified:
   freeswitch/trunk/libs/iksemel/src/stream.c

Modified: freeswitch/trunk/libs/iksemel/src/stream.c
==============================================================================
--- freeswitch/trunk/libs/iksemel/src/stream.c	(original)
+++ freeswitch/trunk/libs/iksemel/src/stream.c	Wed Apr 22 16:43:53 2009
@@ -517,8 +517,8 @@
 		{
 			len = data->trans->recv (data->sock, data->buf, NET_IO_BUF_SIZE - 1, timeout);
 		}
-		if (len < 0) return IKS_NET_RWERR;
-		if (len == 0) break;
+		if (len <= 0) return IKS_NET_RWERR;
+
 		data->buf[len] = '\0';
 		if (data->logHook) data->logHook (data->user_data, data->buf, len, 1);
 		ret = iks_parse (prs, data->buf, len, 0);



More information about the Freeswitch-svn mailing list