aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-04-19 12:29:45 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-04-19 18:24:25 +0200
commitdf0ad6c1a4e23a96428e435af7ba54c2f367546b (patch)
treec84e3b426235bcbddc83b871a2aee23f48ea2211 /examples
parente259c8ab18ce53bd58d022b2c6a193b4a2ec5b1b (diff)
osmux: Move examples and tests to use new output APIs
Diffstat (limited to 'examples')
-rw-r--r--examples/osmux-test-output.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/osmux-test-output.c b/examples/osmux-test-output.c
index 9b7c113..0ab03a7 100644
--- a/examples/osmux-test-output.c
+++ b/examples/osmux-test-output.c
@@ -88,7 +88,6 @@ int read_cb(struct osmo_dgram *conn)
{
struct msgb *msg;
struct osmux_hdr *osmuxh;
- struct llist_head list;
LOGP(DOSMUX_TEST, LOGL_DEBUG, "received message from datagram\n");
@@ -107,10 +106,8 @@ int read_cb(struct osmo_dgram *conn)
LOGP(DOSMUX_TEST, LOGL_DEBUG, "received OSMUX message (len=%d) %s\n",
msg->len, buf);
- while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) {
- osmux_xfrm_output(osmuxh, &h_output, &list);
- osmux_tx_sched(&list, tx_cb, NULL);
- }
+ while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL)
+ osmux_xfrm_output_sched(&h_output, osmuxh);
return 0;
}
@@ -120,6 +117,7 @@ void sighandler(int foo)
LOGP(DOSMUX_TEST, LOGL_NOTICE, "closing OSMUX.\n");
osmo_dgram_close(conn);
osmo_dgram_destroy(conn);
+ osmux_xfrm_output_flush(&h_output);
osmo_rtp_handle_free(rtp);
amr_close();
exit(EXIT_SUCCESS);
@@ -158,7 +156,7 @@ int main(int argc, char *argv[])
* initialize OSMUX handlers.
*/
osmux_xfrm_output_init(&h_output, random());
-
+ osmux_xfrm_output_set_tx_cb(&h_output, tx_cb, NULL);
/*
* initialize datagram server.
*/