Fix pbx_wilcalu from occupying 100% CPU now that it's nonblocking, and add malloc debug

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-04-28 19:58:43 +00:00
parent 5526000ece
commit 209a6d00f3
7 changed files with 484 additions and 11 deletions

View File

@@ -60,6 +60,7 @@ static void *autodial(void *ignore)
char * sendbufptr=sendbuf;
int fd=open(dialfile,O_RDONLY|O_NONBLOCK);
int flags = fcntl(fd, F_GETFL);
fd_set fds;
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
printf("Entered Wil-Calu fd=%d\n",fd);
if(fd<0) {
@@ -74,7 +75,11 @@ static void *autodial(void *ignore)
void *pass;
memset(buf,0,257);
FD_ZERO(&fds);
FD_SET(fd, &fds);
ast_select(fd + 1, &fds, NULL, NULL, NULL);
bytes=read(fd,buf,256);
printf("Bytes: %d\n", bytes);
buf[(int)bytes]=0;
if(bytes>0){