{
*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;
DLIST_ADD_END(msg->pending, rec, struct imessaging_rec *);
}
- EVENT_FD_WRITEABLE(msg->event.fde);
+ TEVENT_FD_WRITEABLE(msg->event.fde);
}
/*
talloc_free(rec);
}
if (msg->pending == NULL) {
- EVENT_FD_NOT_WRITEABLE(msg->event.fde);
+ TEVENT_FD_NOT_WRITEABLE(msg->event.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);
}
}
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;
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) {
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);
}
/* 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);
}
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;
}
if (pc->processing) {
if (pc->processing > 1) {
- EVENT_FD_READABLE(pc->fde);
+ TEVENT_FD_READABLE(pc->fde);
}
pc->processing = 0;
}
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);
}
{
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);
}
}
/* 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);
}
/*
return NT_STATUS_NO_MEMORY;
}
- EVENT_FD_WRITEABLE(pc->fde);
+ TEVENT_FD_WRITEABLE(pc->fde);
return NT_STATUS_OK;
}
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;
}
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;
}
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;
}
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;
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;