Browse files

sip_transport_tcp/tls: Set factory on transports created from accept

The ability to re-use tcp and tls transports when a factory is
specified now depends on transport->factory being set which is a new field
in 2.5.  This was being set only on new outgoing sockets not on
incoming sockets.  The result was that a client REGISTER created a new
socket but without the factory set, the next outgoing request to the
client, OPTIONS, INVITE, etc, would attempt to create another socket
which the client would refuse.

This patch sets the factory on transports created as a result of an
1 parent 5984902 commit 9323442b425babd6d3ac94b9feaf82d1f88babd0 @gtjoseph gtjoseph committed May 30, 2016
Showing with 2 additions and 0 deletions.
  1. +1 −0 pjsip/src/pjsip/sip_transport_tcp.c
  2. +1 −0 pjsip/src/pjsip/sip_transport_tls.c
@@ -713,6 +713,7 @@ static pj_status_t tcp_create( struct tcp_listener *listener,
tcp->base.send_msg = &tcp_send_msg;
tcp->base.do_shutdown = &tcp_shutdown;
tcp->base.destroy = &tcp_destroy_transport;
+ tcp->base.factory = &listener->factory;
/* Create group lock */
status = pj_grp_lock_create(pool, NULL, &tcp->grp_lock);
@@ -742,6 +742,7 @@ static pj_status_t tls_create( struct tls_listener *listener,
tls->base.send_msg = &tls_send_msg;
tls->base.do_shutdown = &tls_shutdown;
tls->base.destroy = &tls_destroy_transport;
+ tls->base.factory = &listener->factory;
tls->ssock = ssock;

0 comments on commit 9323442

Please sign in to comment.