Commit cb62dcb8 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

tport: use msg_ref() and msg_unref()

parent 233a9914
...@@ -2227,7 +2227,7 @@ int tport_shutdown0(tport_t *self, int how) ...@@ -2227,7 +2227,7 @@ int tport_shutdown0(tport_t *self, int how)
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
if (self->tp_queue[i]) { if (self->tp_queue[i]) {
tport_pending_errmsg(self, self->tp_queue[i], EPIPE); tport_pending_errmsg(self, self->tp_queue[i], EPIPE);
msg_ref_destroy(self->tp_queue[i]), self->tp_queue[i] = NULL; msg_unref(self->tp_queue[i]), self->tp_queue[i] = NULL;
} }
} }
} }
...@@ -3001,7 +3001,7 @@ static void tport_parse(tport_t *self, int complete, su_time_t now) ...@@ -3001,7 +3001,7 @@ static void tport_parse(tport_t *self, int complete, su_time_t now)
if (n == -1) if (n == -1)
next = NULL; next = NULL;
else if (streaming) else if (streaming)
next = msg_ref_create(msg); /* Keep a reference */ next = msg_ref(msg); /* Keep a reference */
else if (tport_is_stream(self)) else if (tport_is_stream(self))
next = msg_next(msg); next = msg_next(msg);
else else
...@@ -3859,7 +3859,7 @@ int tport_queue(tport_t *self, msg_t *msg) ...@@ -3859,7 +3859,7 @@ int tport_queue(tport_t *self, msg_t *msg)
} }
} }
self->tp_queue[qhead] = msg_ref_create(msg); self->tp_queue[qhead] = msg_ref(msg);
return 0; return 0;
} }
...@@ -3939,7 +3939,7 @@ int tport_tqsend(tport_t *self, msg_t *msg, msg_t *next, ...@@ -3939,7 +3939,7 @@ int tport_tqsend(tport_t *self, msg_t *msg, msg_t *next,
tport_set_secondary_timer(self); tport_set_secondary_timer(self);
if (!self->tp_unsent) { if (!self->tp_unsent) {
msg_destroy(self->tp_queue[qhead]); msg_destroy(self->tp_queue[qhead]);
if ((self->tp_queue[qhead] = msg_ref_create(next))) if ((self->tp_queue[qhead] = msg_ref(next)))
msg_unprepare(next); msg_unprepare(next);
return 0; return 0;
} }
...@@ -3956,7 +3956,7 @@ int tport_tqsend(tport_t *self, msg_t *msg, msg_t *next, ...@@ -3956,7 +3956,7 @@ int tport_tqsend(tport_t *self, msg_t *msg, msg_t *next,
return -1; return -1;
} }
msg = msg_ref_create(next); msg = msg_ref(next);
do { do {
qhead = (qhead + 1) % N; qhead = (qhead + 1) % N;
......
...@@ -695,7 +695,7 @@ int tport_thread_send(tport_t *tp, ...@@ -695,7 +695,7 @@ int tport_thread_send(tport_t *tp,
tpd->tpd_thrp = thrp; tpd->tpd_thrp = thrp;
tpd->tpd_when = su_now(); tpd->tpd_when = su_now();
tpd->tpd_mtu = mtu; tpd->tpd_mtu = mtu;
tpd->tpd_msg = msg_ref_create(msg); tpd->tpd_msg = msg_ref(msg);
#if HAVE_SIGCOMP #if HAVE_SIGCOMP
tpd->tpd_cc = cc; tpd->tpd_cc = cc;
...@@ -708,7 +708,7 @@ int tport_thread_send(tport_t *tp, ...@@ -708,7 +708,7 @@ int tport_thread_send(tport_t *tp,
return 0; return 0;
} }
msg_ref_destroy(msg); msg_unref(msg);
return -1; return -1;
} }
...@@ -813,6 +813,6 @@ void thrp_udp_send_report(su_root_magic_t *magic, ...@@ -813,6 +813,6 @@ void thrp_udp_send_report(su_root_magic_t *magic,
if (tpd->tpd_errorcode) if (tpd->tpd_errorcode)
tport_error_report(tp, tpd->tpd_errorcode, msg_addr(tpd->tpd_msg)); tport_error_report(tp, tpd->tpd_errorcode, msg_addr(tpd->tpd_msg));
msg_ref_destroy(tpd->tpd_msg); msg_unref(tpd->tpd_msg);
} }
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