X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsiestablish.c;h=f2bb7522f82e499986f14691a082b7079eca12d9;hb=9819507472caa5906a7047b38f50a94d1931ea26;hp=794ea0772c53c87853f55bb28ec586ce8e40dfd0;hpb=280477fab59b789d924830e1a50dc9d2656915af;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/si95/siestablish.c b/src/rmr/si/src/si95/siestablish.c index 794ea07..f2bb752 100644 --- a/src/rmr/si/src/si95/siestablish.c +++ b/src/rmr/si/src/si95/siestablish.c @@ -90,6 +90,7 @@ extern struct tp_blk *SIlisten_prep( int type, char* abuf, int family ) { if( addr != NULL ) { free( addr ); // not needed, but scanners complain if we don't overtly do this } + free( tptr ); return NULL; } @@ -189,6 +190,7 @@ extern struct tp_blk *SIconn_prep( struct ginfo_blk *gptr, int type, char *abuf, if( addr != NULL ) { // not needed, but scanners complain if we don't overtly do this free( addr ); } + free( tptr ); return NULL; } @@ -212,6 +214,17 @@ extern struct tp_blk *SIconn_prep( struct ginfo_blk *gptr, int type, char *abuf, } SETSOCKOPT( tptr->fd, SOL_TCP, TCP_QUICKACK, (void *)&optval, sizeof( optval) ) ; + if( gptr->tcp_flags & SI_TF_QUICK ) { + optval = 1; + SETSOCKOPT( tptr->fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&optval, sizeof( optval) ) ; + optval = 1; + SETSOCKOPT( tptr->fd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&optval, sizeof( optval) ) ; + optval = 1; + SETSOCKOPT( tptr->fd, IPPROTO_TCP, TCP_KEEPINTVL, (void *)&optval, sizeof( optval) ) ; + optval = 5; + SETSOCKOPT( tptr->fd, IPPROTO_TCP, TCP_KEEPCNT, (void *)&optval, sizeof( optval) ) ; + } + tptr->paddr = addr; // tuck the remote peer address away if( need_smartc( abuf ) ) { tptr->flags |= TPF_SAFEC;