[Asterisk-code-review] PJSIP: provide valid tcp nodelay option for reuse (asterisk[master])

Scott Griepentrog asteriskteam at digium.com
Thu Jul 7 10:56:14 CDT 2016


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/3150

Change subject: PJSIP: provide valid tcp nodelay option for reuse
......................................................................

PJSIP: provide valid tcp nodelay option for reuse

When using TCP transport with chan_pjsip, the TCP_NODELAY
option value was allocated on the stack, then passed as a
pointer to the tcp transport configuration structure, and
later re-used on subsequently created sockets when it was
no longer valid.  This patch changes the allocation to be
a static.

ASTERISK-26180 #close
Reported by: Scott Griepentrog

Change-Id: I3251164c7f710dbdab031282f00e30a9770626a0
---
M res/res_pjsip/config_transport.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/3150/1

diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index b920897..9ccf35c 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -562,7 +562,7 @@
 		}
 	} else if (transport->type == AST_TRANSPORT_TCP) {
 		pjsip_tcp_transport_cfg cfg;
-		int option = 1;
+		static int option = 1;
 
 		pjsip_tcp_transport_cfg_default(&cfg, temp_state->state->host.addr.sa_family);
 		cfg.bind_addr = temp_state->state->host;

-- 
To view, visit https://gerrit.asterisk.org/3150
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3251164c7f710dbdab031282f00e30a9770626a0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list