daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33228 )
Change subject: stream: Properly name osmo_stream_srv read callback ......................................................................
stream: Properly name osmo_stream_srv read callback
Change-Id: I12d74e9b407f1ea7af83fb3ec4d03ad7228a27cf --- M include/osmocom/netif/stream.h M src/stream.c 2 files changed, 15 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/28/33228/1
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index a52e7c4..b9a7c6d 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -44,7 +44,7 @@ * osmo_stream_srv_link */ struct osmo_stream_srv;
-struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, int (*cb)(struct osmo_stream_srv *conn), int (*closed_cb)(struct osmo_stream_srv *conn), void *data); +struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, int (*read_cb)(struct osmo_stream_srv *conn), int (*closed_cb)(struct osmo_stream_srv *conn), void *data); void *osmo_stream_srv_get_data(struct osmo_stream_srv *conn); struct osmo_stream_srv_link *osmo_stream_srv_get_master(struct osmo_stream_srv *conn); struct osmo_fd *osmo_stream_srv_get_ofd(struct osmo_stream_srv *srv); diff --git a/src/stream.c b/src/stream.c index 6afb7ca..c62d875 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1307,7 +1307,7 @@ struct osmo_fd ofd; struct llist_head tx_queue; int (*closed_cb)(struct osmo_stream_srv *peer); - int (*cb)(struct osmo_stream_srv *peer); + int (*read_cb)(struct osmo_stream_srv *peer); void *data; int flags; }; @@ -1323,8 +1323,8 @@ return 0; }
- if (conn->cb) - rc = conn->cb(conn); + if (conn->read_cb) + rc = conn->read_cb(conn);
return rc; } @@ -1415,7 +1415,7 @@ struct osmo_stream_srv * osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, - int (*cb)(struct osmo_stream_srv *conn), + int (*read_cb)(struct osmo_stream_srv *conn), int (*closed_cb)(struct osmo_stream_srv *conn), void *data) { struct osmo_stream_srv *conn; @@ -1430,7 +1430,7 @@ } conn->srv = link; osmo_fd_setup(&conn->ofd, fd, OSMO_FD_READ, osmo_stream_srv_cb, conn, 0); - conn->cb = cb; + conn->read_cb = read_cb; conn->closed_cb = closed_cb; conn->data = data; INIT_LLIST_HEAD(&conn->tx_queue);