osmo_io: Add iofd_handle_recv()
Handle msg reception in a common function that can be called from the
different backends.
Change-Id: Ifc407d446805f885d37767f421ff710cb276a01f
diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c
index 77a741a..c230188 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -67,18 +67,7 @@
if (rc > 0)
msgb_put(msg, rc);
- switch (iofd->mode) {
- case OSMO_IO_FD_MODE_READ_WRITE:
- iofd_handle_segmented_read(iofd, msg, rc);
- break;
- case OSMO_IO_FD_MODE_RECVFROM_SENDTO:
- iofd->io_ops.recvfrom_cb(iofd, rc, msg, &hdr.osa);
- break;
- case OSMO_IO_FD_MODE_SCTP_RECVMSG_SENDMSG:
- /* TODO Implement */
- OSMO_ASSERT(false);
- break;
- }
+ iofd_handle_recv(iofd, msg, rc, &hdr);
}
if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED))