Commit 5fe7485c authored by Michael Jerris's avatar Michael Jerris

NTATAG_SERVER_RPORT(2) to act like there is always rport in via

darcs-hash:20080525212346-16063-29f14b961bba54677d495fec8938b95892b7a86e.gz
parent 1819f294
...@@ -987,7 +987,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags) ...@@ -987,7 +987,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
void *smime = agent->sa_smime; void *smime = agent->sa_smime;
uint32_t flags = agent->sa_flags; uint32_t flags = agent->sa_flags;
int rport = agent->sa_rport; int rport = agent->sa_rport;
int server_rport = agent->sa_server_rport; unsigned server_rport = agent->sa_server_rport;
int tcp_rport = agent->sa_tcp_rport; int tcp_rport = agent->sa_tcp_rport;
unsigned preload = agent->sa_preload; unsigned preload = agent->sa_preload;
unsigned threadpool = agent->sa_tport_threadpool; unsigned threadpool = agent->sa_tport_threadpool;
...@@ -2579,6 +2579,10 @@ int agent_check_request_via(nta_agent_t *agent, ...@@ -2579,6 +2579,10 @@ int agent_check_request_via(nta_agent_t *agent,
rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port)); rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport); msg_header_replace_param(msg_home(msg), v->v_common, rport);
} }
else if (agent->sa_server_rport == 2) {
rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport);
}
return 0; return 0;
} }
......
...@@ -226,7 +226,7 @@ struct nta_agent_s ...@@ -226,7 +226,7 @@ struct nta_agent_s
/** If true, use rport at client */ /** If true, use rport at client */
unsigned sa_rport:1; unsigned sa_rport:1;
/** If true, use rport at server */ /** If true, use rport at server */
unsigned sa_server_rport:1; unsigned sa_server_rport:2;
/** If true, use rport with tcp, too */ /** If true, use rport with tcp, too */
unsigned sa_tcp_rport:1; unsigned sa_tcp_rport:1;
......
...@@ -1334,7 +1334,7 @@ tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport); ...@@ -1334,7 +1334,7 @@ tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
* *
* @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via
*/ */
tag_typedef_t ntatag_server_rport = BOOLTAG_TYPEDEF(server_rport); tag_typedef_t ntatag_server_rport = UINTTAG_TYPEDEF(server_rport);
/**@def NTATAG_TCP_RPORT(x) /**@def NTATAG_TCP_RPORT(x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment