Commit 7a672bcd authored by Simon Morlat's avatar Simon Morlat

prevent assert if no tport can be found, which is the case when forwarding a...

prevent assert if no tport can be found, which is the case when forwarding a response to an invalid uri (for example: protocol is not any of UDP, TCP, TLS...)
parent bb34acba
......@@ -3449,6 +3449,11 @@ int nta_msg_tsend(nta_agent_t *agent, msg_t *msg, url_string_t const *u,
tport = tport_by_name(agent->sa_tports, tpn);
if (!tport)
tport = tport_by_protocol(agent->sa_tports, tpn->tpn_proto);
if (!tport){
SU_DEBUG3(("%s: bad tport name, could not find tport.\n",what));
retval=-1;
goto end;
}
if (retry_without_rport)
tpn->tpn_port = sip_via_port(sip->sip_via, NULL);
......@@ -3476,6 +3481,7 @@ int nta_msg_tsend(nta_agent_t *agent, msg_t *msg, url_string_t const *u,
retval = 0;
}
end:
if (retval == 0)
SU_DEBUG_5(("%s\n", what));
......
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