 
            daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34576?usp=email )
Change subject: stream_srv: Make osmo_stream_srv_clear_tx_queue() aware of osmo_io ......................................................................
stream_srv: Make osmo_stream_srv_clear_tx_queue() aware of osmo_io
Change-Id: I818fe4e3792ed88ae4d6fd6afb677b39264ab662 --- M src/stream_srv.c 1 file changed, 22 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/76/34576/1
diff --git a/src/stream_srv.c b/src/stream_srv.c index ca22e1b..dea6f3e 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -957,8 +957,19 @@
void osmo_stream_srv_clear_tx_queue(struct osmo_stream_srv *conn) { - msgb_queue_free(&conn->tx_queue); - osmo_fd_write_disable(&conn->ofd); + switch (conn->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + msgb_queue_free(&conn->tx_queue); + osmo_fd_write_disable(&conn->ofd); + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_iofd_txqueue_clear(conn->iofd); + break; + case OSMO_STREAM_MODE_UNKNOWN: + default: + break; + } + if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) osmo_stream_srv_destroy(conn); }