Convert wb_resp_write to tevent_req
authorVolker Lendecke <vl@samba.org>
Sun, 8 Mar 2009 09:28:05 +0000 (10:28 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Mar 2009 10:21:00 +0000 (11:21 +0100)
source3/include/wbc_async.h
source3/lib/wb_reqtrans.c

index 27af31f27a6ad84a49b9d25a41b807f17a517ced..5aac64d48ea80e78b133d53228a80d14adad381b 100644 (file)
@@ -60,10 +60,9 @@ struct tevent_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
 wbcErr wb_resp_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                         struct winbindd_response **presp);
 
-struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev, int fd,
-                                   struct winbindd_response *wb_resp);
-
-wbcErr wb_resp_write_recv(struct async_req *req);
+struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
+                                     struct tevent_context *ev, int fd,
+                                     struct winbindd_response *wb_resp);
+wbcErr wb_resp_write_recv(struct tevent_req *req);
 
 #endif /*_WBC_ASYNC_H_*/
index 1f7713b02dd97a113cd87433e2fc881b95ba47b9..f1856be6dd4406ff6e742aaa1f9fb8bdf363b8a6 100644 (file)
@@ -371,17 +371,16 @@ struct resp_write_state {
 
 static void wb_resp_write_done(struct tevent_req *subreq);
 
-struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev, int fd,
-                                   struct winbindd_response *wb_resp)
+struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
+                                     struct tevent_context *ev, int fd,
+                                     struct winbindd_response *wb_resp)
 {
-       struct async_req *result;
-       struct tevent_req *subreq;
+       struct tevent_req *result, *subreq;
        struct resp_write_state *state;
        int count = 1;
 
-       if (!async_req_setup(mem_ctx, &result, &state,
-                            struct resp_write_state)) {
+       result = tevent_req_create(mem_ctx, &state, struct resp_write_state);
+       if (result == NULL) {
                return NULL;
        }
 
@@ -409,21 +408,21 @@ struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
 
 static void wb_resp_write_done(struct tevent_req *subreq)
 {
-       struct async_req *req =
-               tevent_req_callback_data(subreq, struct async_req);
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
        int err;
        ssize_t ret;
 
        ret = writev_recv(subreq, &err);
        TALLOC_FREE(subreq);
        if (ret < 0) {
-               async_req_error(req, map_wbc_err_from_errno(err));
+               tevent_req_error(req, map_wbc_err_from_errno(err));
                return;
        }
-       async_req_done(req);
+       tevent_req_done(req);
 }
 
-wbcErr wb_resp_write_recv(struct async_req *req)
+wbcErr wb_resp_write_recv(struct tevent_req *req)
 {
-       return async_req_simple_recv_wbcerr(req);
+       return tevent_req_simple_recv_wbcerr(req);
 }