X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsisend.c;fp=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsisend.c;h=2652737e43b041091f066763f5220285218c1920;hb=cc314e0c526a0ed0ce9295e490b3f2bb29c3332c;hp=c0233aeabe805d2bca0eaaed10b3d668c0eafaf4;hpb=40e32867174c51c9b0ea50dfea19130c468cc200;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/si95/sisend.c b/src/rmr/si/src/si95/sisend.c index c0233ae..2652737 100644 --- a/src/rmr/si/src/si95/sisend.c +++ b/src/rmr/si/src/si95/sisend.c @@ -35,44 +35,34 @@ * Returns: Nothing. * Date: 27 March 1995 * Author: E. Scott Daniels -* Mod: 22 Feb 2002 - To support sendqueue tail +* Mod: 22 Feb 2002 - To support sendqueue tail * ****************************************************************************** */ -#include "sisetup.h" // get include files etc +#include "sisetup.h" // get include files etc #include "sitransport.h" extern void SIsend( struct ginfo_blk *gptr, struct tp_blk *tpptr ) { - struct t_unitdata *udata; // pointer at UDP unit data - struct ioq_blk *qptr; // pointer at qio block for free + struct t_unitdata *udata; // pointer at UDP unit data + struct ioq_blk *qptr; // pointer at qio block for free int status; - if( tpptr->squeue == NULL ) // who knows why we were called - return; // nothing queued - just leave - -/* - if( tpptr->type == SOCK_DGRAM ) { // udp send? - sendto( tpptr->fd, tpptr->squeue->data, tpptr->squeue->dlen, 0, tpptr->squeue->addr, sizeof( struct sockaddr ) ); - if( tpptr->squeue->addr != NULL ) - free( tpptr->squeue->data ); - tpptr->squeue->addr = NULL; - } else { -*/ - status= SEND( tpptr->fd, tpptr->squeue->data, tpptr->squeue->dlen, 0 ); -/* + if( tpptr->squeue == NULL ) { // who knows why we were called + return; // nothing queued - just leave } -*/ - free( tpptr->squeue->data ); // trash buffer or the udp block - qptr = tpptr->squeue; // hold pointer for free - tpptr->squeue = tpptr->squeue->next; // next in queue becommes head - if( !tpptr->squeue ) - tpptr->sqtail = NULL; // no tail left either + status= SEND( tpptr->fd, tpptr->squeue->data, tpptr->squeue->dlen, 0 ); + + free( tpptr->squeue->data ); // trash buffer or the udp block + qptr = tpptr->squeue; // hold pointer for free + tpptr->squeue = tpptr->squeue->next; // next in queue becommes head + if( !tpptr->squeue ) { + tpptr->sqtail = NULL; // no tail left either + } free( qptr ); - if( (tpptr->flags & TPF_DRAIN) && tpptr->squeue == NULL ) // done w/ drain? - { + if( (tpptr->flags & TPF_DRAIN) && tpptr->squeue == NULL ) { // done w/ drain? SIterm( gptr, tpptr ); // close the session and mark the block for delte } -} // SIsend +}