Merged revisions 284593,284595 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines
  
  Merged revisions 284478 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines
    
    Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows.
    
    This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing
    a potential crash bug in all supported releases.
    
    (closes issue #17678)
     Reported by: russell
    Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select 
    
    Review: https://reviewboard.asterisk.org/r/824/
  ........
................
  r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines
  
  Failed to rerun bootstrap.sh after last commit
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2010-09-02 05:00:34 +00:00
parent ed423183d6
commit 6c61e312c6
20 changed files with 32225 additions and 8074 deletions

View File

@@ -15,6 +15,7 @@
*****************************************************************************/
#include "asterisk.h"
#include "asterisk/lock.h"
#include "asterisk/poll-compat.h"
#include "ooports.h"
#include "oochannels.h"
@@ -1980,22 +1981,12 @@ int ooStopMonitorCalls()
OOBOOL ooChannelsIsConnectionOK(OOH323CallData *call, OOSOCKET sock)
{
struct timeval to;
fd_set readfds;
int ret = 0, nfds=0;
struct timeval to = { .tv_usec = 500 };
struct pollfd pfds = { .fd = sock, .events = POLLIN };
int ret = 0;
to.tv_sec = 0;
to.tv_usec = 500;
FD_ZERO(&readfds);
ret = ast_poll2(&pfds, 1, &to);
FD_SET(sock, &readfds);
if(nfds < (int)sock)
nfds = (int)sock;
nfds++;
ret = ooSocketSelect(nfds, &readfds, NULL, NULL, &to);
if(ret == -1)
{
OOTRACEERR3("Error in select ...broken pipe check(%s, %s)\n",