s4:lib: use tevent_ fns names instead of legcay event_ ones
authorSimo Sorce <ssorce@redhat.com>
Tue, 25 May 2010 19:28:35 +0000 (15:28 -0400)
committerSimo Sorce <idra@samba.org>
Sat, 13 Aug 2011 13:54:16 +0000 (09:54 -0400)
source4/lib/com/main.c
source4/lib/messaging/messaging.c
source4/lib/socket/connect.c
source4/lib/socket/connect_multi.c
source4/lib/stream/packet.c
source4/lib/tls/tls.c

index 487ed5b712d002d4e44927bb59302359df1c3eda..1f657cef87a6ecc8f9aa3289b32ab8c9a525a1a2 100644 (file)
@@ -28,7 +28,7 @@ WERROR com_init_ctx(struct com_context **ctx, struct tevent_context *event_ctx)
 {
        *ctx = talloc(NULL, struct com_context);
        if (event_ctx == NULL) {
-               event_ctx = event_context_init(*ctx);
+               event_ctx = tevent_context_init(*ctx);
        }
        (*ctx)->event_ctx = event_ctx;
        return WERR_OK;
index 31440db4685a817c3c957aa946410a7909ebdcfe..4a4adac16ffe812f87a7760f619b409a41ccaf03 100644 (file)
@@ -251,7 +251,7 @@ static void msg_retry_timer(struct tevent_context *ev, struct tevent_timer *te,
                DLIST_ADD_END(msg->pending, rec, struct imessaging_rec *);
        }
 
-       EVENT_FD_WRITEABLE(msg->event.fde);     
+       TEVENT_FD_WRITEABLE(msg->event.fde);
 }
 
 /*
@@ -294,7 +294,7 @@ static void imessaging_send_handler(struct imessaging_context *msg)
                talloc_free(rec);
        }
        if (msg->pending == NULL) {
-               EVENT_FD_NOT_WRITEABLE(msg->event.fde);
+               TEVENT_FD_NOT_WRITEABLE(msg->event.fde);
        }
 }
 
@@ -366,10 +366,10 @@ static void imessaging_handler(struct tevent_context *ev, struct tevent_fd *fde,
 {
        struct imessaging_context *msg = talloc_get_type(private_data,
                                                        struct imessaging_context);
-       if (flags & EVENT_FD_WRITE) {
+       if (flags & TEVENT_FD_WRITE) {
                imessaging_send_handler(msg);
        }
-       if (flags & EVENT_FD_READ) {
+       if (flags & TEVENT_FD_READ) {
                imessaging_recv_handler(msg);
        }
 }
@@ -514,7 +514,7 @@ NTSTATUS imessaging_send(struct imessaging_context *msg, struct server_id server
 
        if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
                if (msg->pending == NULL) {
-                       EVENT_FD_WRITEABLE(msg->event.fde);
+                       TEVENT_FD_WRITEABLE(msg->event.fde);
                }
                DLIST_ADD_END(msg->pending, rec, struct imessaging_rec *);
                return NT_STATUS_OK;
@@ -626,7 +626,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
 
        msg->event.ev   = ev;
        msg->event.fde  = tevent_add_fd(ev, msg, socket_get_fd(msg->sock),
-                                      EVENT_FD_READ, imessaging_handler, msg);
+                                       TEVENT_FD_READ, imessaging_handler, msg);
        tevent_fd_set_auto_close(msg->event.fde);
 
        if (auto_remove) {
index b943de8c1448d6a76a9af74614bbf85edc3b9d18..1da8b41bbd7c056f3bf4850aee9771e1dcf52adb 100644 (file)
@@ -58,9 +58,9 @@ static void socket_send_connect(struct composite_context *result)
                return;
        }
 
-       fde = event_add_fd(result->event_ctx, result,
+       fde = tevent_add_fd(result->event_ctx, result,
                           socket_get_fd(state->sock),
-                          EVENT_FD_READ|EVENT_FD_WRITE, 
+                          TEVENT_FD_READ|TEVENT_FD_WRITE,
                           socket_connect_handler, result);
        composite_nomem(fde, result);
 }
index 4ce5115e97dca1df5d0c2bc4635e8cc908529e65..96277a6139518f9f5172082e94453caf76c2bbab 100644 (file)
@@ -161,7 +161,7 @@ static void connect_multi_next_socket(struct composite_context *result)
                /* note that this timer is a child of the single
                   connect attempt state, so it will go away when this
                   request completes */
-               event_add_timed(result->event_ctx, state,
+               tevent_add_timer(result->event_ctx, state,
                                timeval_current_ofs_usec(MULTI_PORT_DELAY),
                                connect_multi_timer, result);
        }
index 98343707c12e441ca4d406f68b91932f8e0a71da..545d518cffa34523006aaa455cb511ff6387e73a 100644 (file)
@@ -251,14 +251,14 @@ _PUBLIC_ void packet_recv(struct packet_context *pc)
        bool recv_retry = false;
 
        if (pc->processing) {
-               EVENT_FD_NOT_READABLE(pc->fde);
+               TEVENT_FD_NOT_READABLE(pc->fde);
                pc->processing++;
                return;
        }
 
        if (pc->recv_disable) {
                pc->recv_need_enable = true;
-               EVENT_FD_NOT_READABLE(pc->fde);
+               TEVENT_FD_NOT_READABLE(pc->fde);
                return;
        }
 
@@ -424,7 +424,7 @@ next_partial:
 
        if (pc->processing) {
                if (pc->processing > 1) {
-                       EVENT_FD_READABLE(pc->fde);
+                       TEVENT_FD_READABLE(pc->fde);
                }
                pc->processing = 0;
        }
@@ -457,7 +457,7 @@ next_partial:
                return;
        }
 
-       event_add_timed(pc->ev, pc, timeval_zero(), packet_next_event, pc);
+       tevent_add_timer(pc->ev, pc, timeval_zero(), packet_next_event, pc);
 }
 
 
@@ -476,11 +476,11 @@ _PUBLIC_ void packet_recv_enable(struct packet_context *pc)
 {
        if (pc->recv_need_enable) {
                pc->recv_need_enable = false;
-               EVENT_FD_READABLE(pc->fde);
+               TEVENT_FD_READABLE(pc->fde);
        }
        pc->recv_disable = false;
        if (pc->num_read != 0 && pc->packet_size >= pc->num_read) {
-               event_add_timed(pc->ev, pc, timeval_zero(), packet_next_event, pc);
+               tevent_add_timer(pc->ev, pc, timeval_zero(), packet_next_event, pc);
        }
 }
 
@@ -523,7 +523,7 @@ _PUBLIC_ void packet_queue_run(struct packet_context *pc)
 
        /* we're out of requests to send, so don't wait for write
           events any more */
-       EVENT_FD_NOT_WRITEABLE(pc->fde);
+       TEVENT_FD_NOT_WRITEABLE(pc->fde);
 }
 
 /*
@@ -561,7 +561,7 @@ _PUBLIC_ NTSTATUS packet_send_callback(struct packet_context *pc, DATA_BLOB blob
                return NT_STATUS_NO_MEMORY;
        }
 
-       EVENT_FD_WRITEABLE(pc->fde);
+       TEVENT_FD_WRITEABLE(pc->fde);
 
        return NT_STATUS_OK;
 }
index 63724e96286d203d7e3b438c0c8a0cee9878a9cb..00c2d134781ffccaf0d4bb0b9772868600b9e9f3 100644 (file)
@@ -126,21 +126,21 @@ static ssize_t tls_pull(gnutls_transport_ptr ptr, void *buf, size_t size)
                return 0;
        }
        if (NT_STATUS_IS_ERR(status)) {
-               EVENT_FD_NOT_READABLE(tls->fde);
-               EVENT_FD_NOT_WRITEABLE(tls->fde);
+               TEVENT_FD_NOT_READABLE(tls->fde);
+               TEVENT_FD_NOT_WRITEABLE(tls->fde);
                errno = EBADF;
                return -1;
        }
        if (!NT_STATUS_IS_OK(status)) {
-               EVENT_FD_READABLE(tls->fde);
+               TEVENT_FD_READABLE(tls->fde);
                errno = EAGAIN;
                return -1;
        }
        if (tls->output_pending) {
-               EVENT_FD_WRITEABLE(tls->fde);
+               TEVENT_FD_WRITEABLE(tls->fde);
        }
        if (size != nread) {
-               EVENT_FD_READABLE(tls->fde);
+               TEVENT_FD_READABLE(tls->fde);
        }
        return nread;
 }
@@ -168,11 +168,11 @@ static ssize_t tls_push(gnutls_transport_ptr ptr, const void *buf, size_t size)
                return -1;
        }
        if (!NT_STATUS_IS_OK(status)) {
-               EVENT_FD_WRITEABLE(tls->fde);
+               TEVENT_FD_WRITEABLE(tls->fde);
                return -1;
        }
        if (size != nwritten) {
-               EVENT_FD_WRITEABLE(tls->fde);
+               TEVENT_FD_WRITEABLE(tls->fde);
        }
        return nwritten;
 }
@@ -205,7 +205,7 @@ static NTSTATUS tls_handshake(struct tls_context *tls)
        ret = gnutls_handshake(tls->session);
        if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
                if (gnutls_record_get_direction(tls->session) == 1) {
-                       EVENT_FD_WRITEABLE(tls->fde);
+                       TEVENT_FD_WRITEABLE(tls->fde);
                }
                return STATUS_MORE_ENTRIES;
        }
@@ -298,7 +298,7 @@ static NTSTATUS tls_socket_recv(struct socket_context *sock, void *buf,
        ret = gnutls_record_recv(tls->session, buf, wantlen);
        if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
                if (gnutls_record_get_direction(tls->session) == 1) {
-                       EVENT_FD_WRITEABLE(tls->fde);
+                       TEVENT_FD_WRITEABLE(tls->fde);
                }
                tls->interrupted = true;
                return STATUS_MORE_ENTRIES;
@@ -334,7 +334,7 @@ static NTSTATUS tls_socket_send(struct socket_context *sock,
        ret = gnutls_record_send(tls->session, blob->data, blob->length);
        if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
                if (gnutls_record_get_direction(tls->session) == 1) {
-                       EVENT_FD_WRITEABLE(tls->fde);
+                       TEVENT_FD_WRITEABLE(tls->fde);
                }
                tls->interrupted = true;
                return STATUS_MORE_ENTRIES;