messages_dgm_ref: Pass receiving "ev" to recv_cb
authorVolker Lendecke <vl@samba.org>
Sat, 24 Sep 2016 01:36:15 +0000 (18:36 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 4 Oct 2016 22:06:22 +0000 (00:06 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/messages.c
source3/lib/messages_dgm_ref.c
source3/lib/messages_dgm_ref.h
source4/lib/messaging/messaging.c

index a396091f774ad3c50ca43049e38009297970bdf6..a3fa5c49dfed844e3795831dea4e5fcff174bef1 100644 (file)
@@ -154,7 +154,8 @@ static struct messaging_rec *messaging_rec_create(
        return result;
 }
 
-static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
+static void messaging_recv_cb(struct tevent_context *ev,
+                             const uint8_t *msg, size_t msg_len,
                              int *fds, size_t num_fds,
                              void *private_data)
 {
index 7b8acf16e904f1ddb4454fb5100323b23842e05b..00a3a66941c9d204be829a50bf0d4bab1864fa12 100644 (file)
@@ -27,7 +27,8 @@
 struct msg_dgm_ref {
        struct msg_dgm_ref *prev, *next;
        void *tevent_handle;
-       void (*recv_cb)(const uint8_t *msg, size_t msg_len,
+       void (*recv_cb)(struct tevent_context *ev,
+                       const uint8_t *msg, size_t msg_len,
                        int *fds, size_t num_fds, void *private_data);
        void *recv_cb_private_data;
 };
@@ -44,7 +45,8 @@ void *messaging_dgm_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                        uint64_t *unique,
                        const char *socket_dir,
                        const char *lockfile_dir,
-                       void (*recv_cb)(const uint8_t *msg, size_t msg_len,
+                       void (*recv_cb)(struct tevent_context *ev,
+                                       const uint8_t *msg, size_t msg_len,
                                        int *fds, size_t num_fds,
                                        void *private_data),
                        void *recv_cb_private_data,
@@ -127,7 +129,7 @@ static void msg_dgm_ref_recv(struct tevent_context *ev,
         */
        for (r = refs; r != NULL; r = next) {
                next = r->next;
-               r->recv_cb(msg, msg_len, fds, num_fds,
+               r->recv_cb(ev, msg, msg_len, fds, num_fds,
                           r->recv_cb_private_data);
        }
 }
index 8f0aff8ec600f07ff9f5ff607ec2b5b0d522e12a..cd771012456b12c3539a0e27b993da983a0ccd8b 100644 (file)
@@ -28,7 +28,8 @@ void *messaging_dgm_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                        uint64_t *unique,
                        const char *socket_dir,
                        const char *lockfile_dir,
-                       void (*recv_cb)(const uint8_t *msg, size_t msg_len,
+                       void (*recv_cb)(struct tevent_context *ev,
+                                       const uint8_t *msg, size_t msg_len,
                                        int *fds, size_t num_fds,
                                        void *private_data),
                        void *recv_cb_private_data,
index c0b64be0f58a815079f050aa51daa4084d835fab..950a68517ce0a0b9bde08496e3a3c9d2ad207522 100644 (file)
@@ -294,7 +294,8 @@ int imessaging_cleanup(struct imessaging_context *msg)
        return 0;
 }
 
-static void imessaging_dgm_recv(const uint8_t *buf, size_t buf_len,
+static void imessaging_dgm_recv(struct tevent_context *ev,
+                               const uint8_t *buf, size_t buf_len,
                                int *fds, size_t num_fds,
                                void *private_data);
 
@@ -415,7 +416,8 @@ fail:
        return NULL;
 }
 
-static void imessaging_dgm_recv(const uint8_t *buf, size_t buf_len,
+static void imessaging_dgm_recv(struct tevent_context *ev,
+                               const uint8_t *buf, size_t buf_len,
                                int *fds, size_t num_fds,
                                void *private_data)
 {