Commit 2b4bbc4e authored by Pekka Pessi's avatar Pekka Pessi

tport.c, nta.c. nth_client.c: using msg_addr() sparingly.

darcs-hash:20060906192304-65a35-736529a032f82a800f3f34ca188d37c5f18eb707.gz
parent aa6c48fa
......@@ -2225,13 +2225,13 @@ int agent_check_request_via(nta_agent_t *agent,
char received[receivedlen + TPORT_HOSTPORTSIZE];
char *hostport = received + receivedlen;
char const *rport;
su_sockaddr_t *from;
su_sockaddr_t const *from;
sip_via_t const *tpv = agent_tport_via(tport);
assert(tport); assert(msg); assert(sip);
assert(sip->sip_request); assert(tpv);
from = (su_sockaddr_t *)msg_addr(msg);
from = msg_addr(msg);
if (v == NULL) {
/* Make up a via line */
......@@ -6969,7 +6969,7 @@ void
outgoing_print_tport_error(nta_outgoing_t *orq, int level, char *todo,
tp_name_t const *tpn, msg_t *msg, int error)
{
su_sockaddr_t *su = msg_addr(msg);
su_sockaddr_t const *su = msg_addr(msg);
char addr[SU_ADDRSIZE];
su_llog(nta_log, level,
......
......@@ -1057,7 +1057,7 @@ static nth_client_t *hc_send(nth_client_t * hc)
void hc_tport_error(nth_engine_t * he, nth_client_t * hc,
tport_t * tp, msg_t *msg, int error)
{
su_sockaddr_t *su = msg_addr(msg);
su_sockaddr_t const *su = msg_addr(msg);
tp_name_t const *tpn = tp ? tport_name(tp) : hc->hc_tpn;
char addr[SU_ADDRSIZE];
char const *errmsg;
......
......@@ -2719,7 +2719,7 @@ void tport_deliver(tport_t *self,
if (tport_is_primary(self)) {
char ipaddr[SU_ADDRSIZE + 2];
su_sockaddr_t *su = msg_addr(msg);
su_sockaddr_t const *su = msg_addr(msg);
#if SU_HAVE_IN6
if (su->su_family == AF_INET6) {
......@@ -3696,7 +3696,7 @@ static int
msg_select_addrinfo(msg_t *msg, su_addrinfo_t *res)
{
su_addrinfo_t *ai, *mai = msg_addrinfo(msg);
su_sockaddr_t *su = msg_addr(msg);
su_sockaddr_t *su = (su_sockaddr_t *)mai->ai_addr;
for (ai = res; ai; ai = ai->ai_next) {
#if SU_HAVE_IN6
......@@ -3867,6 +3867,7 @@ tport_pending_error(tport_t *self, su_sockaddr_t const *dst, int error)
unsigned i, reported, callbacks;
tport_pending_t *pending;
msg_t *msg;
su_addrinfo_t const *ai;
assert(self); assert(dst);
......@@ -3886,8 +3887,9 @@ tport_pending_error(tport_t *self, su_sockaddr_t const *dst, int error)
continue;
msg = pending->p_msg;
if (su_cmp_sockaddr(dst, msg_addr(msg)) != 0)
ai = msg_addrinfo(msg);
if (su_cmp_sockaddr(dst, (su_sockaddr_t *)ai->ai_addr) != 0)
continue;
pending->p_reported = reported;
......
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