summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-25 15:26:42 -0400
committerSimo Sorce <idra@samba.org>2011-08-13 09:54:15 -0400
commitab81505e080e72c2217cb3946b04eee872397763 (patch)
tree4e3536178f2f6f9a27e31e074b4852545d6b294a
parentf364daed2203170bc772c8ff9bb28f78da615669 (diff)
downloadsamba-ab81505e080e72c2217cb3946b04eee872397763.tar.gz
samba-ab81505e080e72c2217cb3946b04eee872397763.tar.bz2
samba-ab81505e080e72c2217cb3946b04eee872397763.zip
s4:libcli: use tevent_ fn names instead of legacy event_ ones
-rw-r--r--source4/libcli/composite/composite.c8
-rw-r--r--source4/libcli/dgram/dgramsocket.c12
-rw-r--r--source4/libcli/dgram/mailslot.c2
-rw-r--r--source4/libcli/raw/clitransport.c14
-rw-r--r--source4/libcli/raw/rawrequest.c2
-rw-r--r--source4/libcli/resolve/dns_ex.c2
-rw-r--r--source4/libcli/smb2/request.c2
-rw-r--r--source4/libcli/smb2/transport.c14
8 files changed, 28 insertions, 28 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index b326b51c1a..26cf5c80ac 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -55,7 +55,7 @@ _PUBLIC_ NTSTATUS composite_wait(struct composite_context *c)
c->used_wait = true;
while (c->state < COMPOSITE_STATE_DONE) {
- if (event_loop_once(c->event_ctx) != 0) {
+ if (tevent_loop_once(c->event_ctx) != 0) {
return NT_STATUS_UNSUCCESSFUL;
}
}
@@ -106,7 +106,7 @@ _PUBLIC_ void composite_error(struct composite_context *ctx, NTSTATUS status)
return;
}
if (!ctx->used_wait && !ctx->async.fn) {
- event_add_timed(ctx->event_ctx, ctx, timeval_zero(), composite_trigger, ctx);
+ tevent_add_timer(ctx->event_ctx, ctx, timeval_zero(), composite_trigger, ctx);
}
ctx->status = status;
ctx->state = COMPOSITE_STATE_ERROR;
@@ -136,7 +136,7 @@ _PUBLIC_ bool composite_is_ok(struct composite_context *ctx)
_PUBLIC_ void composite_done(struct composite_context *ctx)
{
if (!ctx->used_wait && !ctx->async.fn) {
- event_add_timed(ctx->event_ctx, ctx, timeval_zero(), composite_trigger, ctx);
+ tevent_add_timer(ctx->event_ctx, ctx, timeval_zero(), composite_trigger, ctx);
}
ctx->state = COMPOSITE_STATE_DONE;
if (ctx->async.fn != NULL) {
@@ -157,7 +157,7 @@ _PUBLIC_ void composite_continue(struct composite_context *ctx,
already finished, then we should run the callback with an
immediate event, otherwise we can be stuck forever */
if (new_ctx->state >= COMPOSITE_STATE_DONE && continuation) {
- event_add_timed(new_ctx->event_ctx, new_ctx, timeval_zero(), composite_trigger, new_ctx);
+ tevent_add_timer(new_ctx->event_ctx, new_ctx, timeval_zero(), composite_trigger, new_ctx);
}
}
diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c
index 090e67af88..3f06dc72bd 100644
--- a/source4/libcli/dgram/dgramsocket.c
+++ b/source4/libcli/dgram/dgramsocket.c
@@ -131,7 +131,7 @@ static void dgm_socket_send(struct nbt_dgram_socket *dgmsock)
talloc_free(req);
}
- EVENT_FD_NOT_WRITEABLE(dgmsock->fde);
+ TEVENT_FD_NOT_WRITEABLE(dgmsock->fde);
return;
}
@@ -144,10 +144,10 @@ static void dgm_socket_handler(struct tevent_context *ev, struct tevent_fd *fde,
{
struct nbt_dgram_socket *dgmsock = talloc_get_type(private_data,
struct nbt_dgram_socket);
- if (flags & EVENT_FD_WRITE) {
+ if (flags & TEVENT_FD_WRITE) {
dgm_socket_send(dgmsock);
}
- if (flags & EVENT_FD_READ) {
+ if (flags & TEVENT_FD_READ) {
dgm_socket_recv(dgmsock);
}
}
@@ -175,7 +175,7 @@ struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx,
talloc_steal(dgmsock, dgmsock->sock);
- dgmsock->fde = event_add_fd(dgmsock->event_ctx, dgmsock,
+ dgmsock->fde = tevent_add_fd(dgmsock->event_ctx, dgmsock,
socket_get_fd(dgmsock->sock), 0,
dgm_socket_handler, dgmsock);
@@ -202,7 +202,7 @@ NTSTATUS dgram_set_incoming_handler(struct nbt_dgram_socket *dgmsock,
{
dgmsock->incoming.handler = handler;
dgmsock->incoming.private_data = private_data;
- EVENT_FD_READABLE(dgmsock->fde);
+ TEVENT_FD_READABLE(dgmsock->fde);
return NT_STATUS_OK;
}
@@ -233,7 +233,7 @@ NTSTATUS nbt_dgram_send(struct nbt_dgram_socket *dgmsock,
DLIST_ADD_END(dgmsock->send_queue, req, struct nbt_dgram_request *);
- EVENT_FD_WRITEABLE(dgmsock->fde);
+ TEVENT_FD_WRITEABLE(dgmsock->fde);
return NT_STATUS_OK;
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index 38dd8fb41e..466c603432 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -71,7 +71,7 @@ struct dgram_mailslot_handler *dgram_mailslot_listen(struct nbt_dgram_socket *dg
DLIST_ADD(dgmsock->mailslot_handlers, dgmslot);
talloc_set_destructor(dgmslot, dgram_mailslot_destructor);
- EVENT_FD_READABLE(dgmsock->fde);
+ TEVENT_FD_READABLE(dgmsock->fde);
return dgmslot;
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 43316692a4..08e49fdd1a 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -39,11 +39,11 @@ static void smbcli_transport_event_handler(struct tevent_context *ev,
{
struct smbcli_transport *transport = talloc_get_type(private_data,
struct smbcli_transport);
- if (flags & EVENT_FD_READ) {
+ if (flags & TEVENT_FD_READ) {
packet_recv(transport->packet);
return;
}
- if (flags & EVENT_FD_WRITE) {
+ if (flags & TEVENT_FD_WRITE) {
packet_queue_run(transport->packet);
}
}
@@ -113,10 +113,10 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
/* take over event handling from the socket layer - it only
handles events up until we are connected */
talloc_free(transport->socket->event.fde);
- transport->socket->event.fde = event_add_fd(transport->socket->event.ctx,
+ transport->socket->event.fde = tevent_add_fd(transport->socket->event.ctx,
transport->socket->sock,
socket_get_fd(transport->socket->sock),
- EVENT_FD_READ,
+ TEVENT_FD_READ,
smbcli_transport_event_handler,
transport);
@@ -312,7 +312,7 @@ static void idle_handler(struct tevent_context *ev,
struct smbcli_transport *transport = talloc_get_type(private_data,
struct smbcli_transport);
struct timeval next = timeval_add(&t, 0, transport->idle.period);
- transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
+ transport->socket->event.te = tevent_add_timer(transport->socket->event.ctx,
transport,
next,
idle_handler, transport);
@@ -336,7 +336,7 @@ _PUBLIC_ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
talloc_free(transport->socket->event.te);
}
- transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
+ transport->socket->event.te = tevent_add_timer(transport->socket->event.ctx,
transport,
timeval_current_ofs_usec(period),
idle_handler, transport);
@@ -609,7 +609,7 @@ void smbcli_transport_send(struct smbcli_request *req)
/* add a timeout */
if (req->transport->options.request_timeout) {
- event_add_timed(req->transport->socket->event.ctx, req,
+ tevent_add_timer(req->transport->socket->event.ctx, req,
timeval_current_ofs(req->transport->options.request_timeout, 0),
smbcli_timeout_handler, req);
}
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index bf0268867f..c9b78d726b 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -358,7 +358,7 @@ bool smbcli_request_receive(struct smbcli_request *req)
/* keep receiving packets until this one is replied to */
while (req->state <= SMBCLI_REQUEST_RECV) {
- if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+ if (tevent_loop_once(req->transport->socket->event.ctx) != 0) {
return false;
}
}
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 5921212579..8f21b7fde5 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -531,7 +531,7 @@ struct composite_context *resolve_name_dns_ex_send(TALLOC_CTX *mem_ctx,
/* we need to put the child in our event context so
we know when the dns_lookup() has finished */
- state->fde = event_add_fd(c->event_ctx, c, state->child_fd, EVENT_FD_READ,
+ state->fde = tevent_add_fd(c->event_ctx, c, state->child_fd, TEVENT_FD_READ,
pipe_handler, c);
if (composite_nomem(state->fde, c)) {
close(fd[0]);
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 729b003aed..cf416a61cf 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -214,7 +214,7 @@ bool smb2_request_receive(struct smb2_request *req)
/* keep receiving packets until this one is replied to */
while (req->state <= SMB2_REQUEST_RECV) {
- if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+ if (tevent_loop_once(req->transport->socket->event.ctx) != 0) {
return false;
}
}
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 04b2d38327..538cb5f1de 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -39,11 +39,11 @@ static void smb2_transport_event_handler(struct tevent_context *ev,
{
struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
- if (flags & EVENT_FD_READ) {
+ if (flags & TEVENT_FD_READ) {
packet_recv(transport->packet);
return;
}
- if (flags & EVENT_FD_WRITE) {
+ if (flags & TEVENT_FD_WRITE) {
packet_queue_run(transport->packet);
}
}
@@ -104,10 +104,10 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
/* take over event handling from the socket layer - it only
handles events up until we are connected */
talloc_free(transport->socket->event.fde);
- transport->socket->event.fde = event_add_fd(transport->socket->event.ctx,
+ transport->socket->event.fde = tevent_add_fd(transport->socket->event.ctx,
transport->socket,
socket_get_fd(transport->socket->sock),
- EVENT_FD_READ,
+ TEVENT_FD_READ,
smb2_transport_event_handler,
transport);
@@ -525,7 +525,7 @@ void smb2_transport_send(struct smb2_request *req)
/* add a timeout */
if (req->transport->options.request_timeout) {
- event_add_timed(req->transport->socket->event.ctx, req,
+ tevent_add_timer(req->transport->socket->event.ctx, req,
timeval_current_ofs(req->transport->options.request_timeout, 0),
smb2_timeout_handler, req);
}
@@ -565,7 +565,7 @@ static void idle_handler(struct tevent_context *ev,
struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
struct timeval next = timeval_add(&t, 0, transport->idle.period);
- transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
+ transport->socket->event.te = tevent_add_timer(transport->socket->event.ctx,
transport,
next,
idle_handler, transport);
@@ -589,7 +589,7 @@ void smb2_transport_idle_handler(struct smb2_transport *transport,
talloc_free(transport->socket->event.te);
}
- transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
+ transport->socket->event.te = tevent_add_timer(transport->socket->event.ctx,
transport,
timeval_current_ofs(0, period),
idle_handler, transport);