X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsipoll.c;h=8c28977cddc36fe7b99ec09fa929da386b5ab8fb;hb=c113b0836f3ebd58911c30de1636a707174efe55;hp=0ecca665e31c2aa46e65cba5e24e0b46c2c5b3fd;hpb=5861625ff2eaf1bd3a69ce488bd7d14f7b402432;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/si95/sipoll.c b/src/rmr/si/src/si95/sipoll.c index 0ecca66..8c28977 100644 --- a/src/rmr/si/src/si95/sipoll.c +++ b/src/rmr/si/src/si95/sipoll.c @@ -53,7 +53,7 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) char ibuf[1025]; int i; // loop index struct tp_blk *tpptr; // pointer at tp stuff - struct tp_blk *nextone; // pointer at next block to process + struct tp_blk *nextone = NULL; // pointer at next block to process int pstat; // poll status int kstat; // keyboard status struct timeval delay; // delay to use on select call @@ -120,9 +120,9 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) } // for( tpptr = gptr->tplist; tpptr != NULL; tpptr = tpptr->next ) - for( tpptr = gptr->tplist; tpptr != NULL; tpptr = nextone ) - { - nextone = tpptr->next; // prevent coredump if we delete the session + tpptr = gptr->tplist; + while( tpptr != NULL ) { + nextone = tpptr->next; // allow for a delete in loop if( tpptr->squeue != NULL && (FD_ISSET( tpptr->fd, &gptr->writefds )) ) SIsend( gptr, tpptr ); // send if clear to send @@ -180,6 +180,8 @@ extern int SIpoll( struct ginfo_blk *gptr, int msdelay ) } } // end tcp read } // end if event on this fd + + tpptr = nextone; } // end for each fd in the list } // end if not in shutdown