[svn-commits] russell: branch 1.6.2 r278479 - in /branches/1.6.2: ./ res/res_timing_pthread.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 21 11:20:32 CDT 2010


Author: russell
Date: Wed Jul 21 11:20:18 2010
New Revision: 278479

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278479
Log:
Merged revisions 278465 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r278465 | russell | 2010-07-21 11:15:00 -0500 (Wed, 21 Jul 2010) | 41 lines
  
  Use poll() instead of select() in res_timing_pthread to avoid stack corruption.
  
  This code did not properly check FD_SETSIZE to ensure that it did not try to
  select() on fds that were too large.  Switching to poll() removes the limitation
  on the maximum fd value.
  
  (closes issue #15915)
  Reported by: keiron
  
  (closes issue #17187)
  Reported by: Eddie Edwards
  
  (closes issue #16494)
  Reported by: Hubguru
  
  (closes issue #15731)
  Reported by: flop
  
  (closes issue #12917)
  Reported by: falves11
  
  (closes issue #14920)
  Reported by: vrban
  
  (closes issue #17199)
  Reported by: aleksey2000
  
  (closes issue #15406)
  Reported by: kowalma
  
  (closes issue #17438)
  Reported by: dcabot
  
  (closes issue #17325)
  Reported by: glwgoes
  
  (closes issue #17118)
  Reported by: erikje
  
  possibly other issues, too ...
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/res/res_timing_pthread.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/res/res_timing_pthread.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/res/res_timing_pthread.c?view=diff&rev=278479&r1=278478&r2=278479
==============================================================================
--- branches/1.6.2/res/res_timing_pthread.c (original)
+++ branches/1.6.2/res/res_timing_pthread.c Wed Jul 21 11:20:18 2010
@@ -36,6 +36,7 @@
 #include "asterisk/astobj2.h"
 #include "asterisk/time.h"
 #include "asterisk/lock.h"
+#include "asterisk/poll-compat.h"
 
 static void *timing_funcs_handle;
 
@@ -376,16 +377,12 @@
 	do {
 		unsigned char buf[1024];
 		ssize_t res;
-		fd_set rfds;
-		struct timeval timeout = {
-			.tv_sec = 0,
+		struct pollfd pfd = {
+			.fd = rd_fd,
+			.events = POLLIN,
 		};
 
-		/* Make sure there is data to read */
-		FD_ZERO(&rfds);
-		FD_SET(rd_fd, &rfds);
-
-		if (select(rd_fd + 1, &rfds, NULL, NULL, &timeout) != 1) {
+		if (ast_poll(&pfd, 1, 0) != 1) {
 			ast_debug(1, "Reading not available on timing pipe, "
 					"quantity: %u\n", quantity);
 			break;




More information about the svn-commits mailing list