X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsisend.c;h=2652737e43b041091f066763f5220285218c1920;hb=fcea3951d44de0cc55d33c5e114487abe79d3406;hp=5a8a94e38ccc476985619c7371251cbc5a040820;hpb=ec88d3c0563eeb6ae5f73427edb0b3c4d7acf299;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 5a8a94e..2652737 100644 --- a/src/rmr/si/src/si95/sisend.c +++ b/src/rmr/si/src/si95/sisend.c @@ -35,53 +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; -//static int announced = 0; // TESTING - 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 } -*/ + status= SEND( tpptr->fd, tpptr->squeue->data, tpptr->squeue->dlen, 0 ); -/* -//TESTING -if( !announced && status < tpptr->squeue->dlen ) { -announced = 1; -fprintf( stderr, ">>>>>>> !!!!!! SIsend: short send: %d != %d\n", status, tpptr->squeue->dlen ); -} -*/ - 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( 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? - { - SIterm( gptr, tpptr ); // trash the tp block + if( (tpptr->flags & TPF_DRAIN) && tpptr->squeue == NULL ) { // done w/ drain? + SIterm( gptr, tpptr ); // close the session and mark the block for delte } -} // SIsend +}