From: Volker Lendecke Date: Sun, 24 Apr 2016 15:36:00 +0000 (+0200) Subject: ctdbd_conn: Expose ctdb socket readability handler X-Git-Tag: tdb-1.3.10~1119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33c8861fc5ed828fe8e1d5b752f09a0c0ea4cc55;p=thirdparty%2Fsamba.git ctdbd_conn: Expose ctdb socket readability handler This will obsolete ctdbd_register_msg_ctx soon Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 026db04babd..282379dc9d6 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -42,6 +42,7 @@ int ctdbd_register_msg_ctx(struct ctdbd_connection *conn, struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn); int ctdbd_conn_get_fd(struct ctdbd_connection *conn); +void ctdbd_socket_readable(struct ctdbd_connection *conn); int ctdbd_messaging_send_iov(struct ctdbd_connection *conn, uint32_t dst_vnn, uint64_t dst_srvid, diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 18849757470..e54ec7e8d00 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -508,17 +508,8 @@ static int ctdb_handle_message(struct ctdbd_connection *conn, return 0; } -/* - * The ctdbd socket is readable asynchronuously - */ - -static void ctdbd_socket_handler(struct tevent_context *event_ctx, - struct tevent_fd *event, - uint16_t flags, - void *private_data) +void ctdbd_socket_readable(struct ctdbd_connection *conn) { - struct ctdbd_connection *conn = talloc_get_type_abort( - private_data, struct ctdbd_connection); struct ctdb_req_header *hdr = NULL; int ret; @@ -538,6 +529,25 @@ static void ctdbd_socket_handler(struct tevent_context *event_ctx, } } +/* + * The ctdbd socket is readable asynchronuously + */ + +static void ctdbd_socket_handler(struct tevent_context *event_ctx, + struct tevent_fd *event, + uint16_t flags, + void *private_data) +{ + struct ctdbd_connection *conn = talloc_get_type_abort( + private_data, struct ctdbd_connection); + + if ((flags & TEVENT_FD_READ) == 0) { + return; + } + + ctdbd_socket_readable(conn); +} + /* * Prepare a ctdbd connection to receive messages */