summaryrefslogtreecommitdiff
path: root/lib/async_req
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-20 16:40:09 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-20 16:40:09 +0100
commitca202cf464aec82e63be4b2160f394f56b8c195e (patch)
tree58b432b7d67c5cf3b35a16c7df9b028d39e3b3a5 /lib/async_req
parent44787565715f0622cc1d049854427d735ca1c14b (diff)
parent2de464a7658f91d2d01087080b984d52c3483426 (diff)
downloadsamba-ca202cf464aec82e63be4b2160f394f56b8c195e.tar.gz
samba-ca202cf464aec82e63be4b2160f394f56b8c195e.tar.bz2
samba-ca202cf464aec82e63be4b2160f394f56b8c195e.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into displaysec
Diffstat (limited to 'lib/async_req')
-rw-r--r--lib/async_req/async_req.c42
-rw-r--r--lib/async_req/async_req.h9
-rw-r--r--lib/async_req/async_sock.c18
3 files changed, 1 insertions, 68 deletions
diff --git a/lib/async_req/async_req.c b/lib/async_req/async_req.c
index 054c9f97cc..4dfe809738 100644
--- a/lib/async_req/async_req.c
+++ b/lib/async_req/async_req.c
@@ -194,48 +194,6 @@ bool async_req_is_error(struct async_req *req, enum async_req_state *state,
return true;
}
-static void async_req_timedout(struct tevent_context *ev,
- struct tevent_timer *te,
- struct timeval now,
- void *priv)
-{
- struct async_req *req = talloc_get_type_abort(priv, struct async_req);
- TALLOC_FREE(te);
- async_req_finish(req, ASYNC_REQ_TIMED_OUT);
-}
-
-bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev,
- struct timeval to)
-{
- return (tevent_add_timer(
- ev, req,
- tevent_timeval_current_ofs(to.tv_sec, to.tv_usec),
- async_req_timedout, req)
- != NULL);
-}
-
-struct async_req *async_wait_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct timeval to)
-{
- struct async_req *result;
-
- result = async_req_new(mem_ctx);
- if (result == NULL) {
- return result;
- }
- if (!async_req_set_timeout(result, ev, to)) {
- TALLOC_FREE(result);
- return NULL;
- }
- return result;
-}
-
-bool async_wait_recv(struct async_req *req)
-{
- return true;
-}
-
struct async_queue_entry {
struct async_queue_entry *prev, *next;
struct async_req_queue *queue;
diff --git a/lib/async_req/async_req.h b/lib/async_req/async_req.h
index fc849880cd..fdec1b708e 100644
--- a/lib/async_req/async_req.h
+++ b/lib/async_req/async_req.h
@@ -139,15 +139,6 @@ bool async_post_error(struct async_req *req, struct tevent_context *ev,
bool async_req_is_error(struct async_req *req, enum async_req_state *state,
uint64_t *error);
-bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev,
- struct timeval to);
-
-struct async_req *async_wait_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct timeval to);
-
-bool async_wait_recv(struct async_req *req);
-
struct async_req_queue;
struct async_req_queue *async_req_queue_init(TALLOC_CTX *mem_ctx);
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index be24bae6df..77df406044 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -389,7 +389,6 @@ struct tevent_req *writev_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
{
struct tevent_req *result;
struct writev_state *state;
- struct tevent_fd *fde;
result = tevent_req_create(mem_ctx, &state, struct writev_state);
if (result == NULL) {
@@ -405,22 +404,7 @@ struct tevent_req *writev_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
goto fail;
}
- /*
- * This if () should go away once our callers are converted to always
- * pass in a queue.
- */
-
- if (queue != NULL) {
- if (!tevent_queue_add(queue, ev, result, writev_trigger,
- NULL)) {
- goto fail;
- }
- return result;
- }
-
- fde = tevent_add_fd(ev, state, fd, TEVENT_FD_WRITE, writev_handler,
- result);
- if (fde == NULL) {
+ if (!tevent_queue_add(queue, ev, result, writev_trigger, NULL)) {
goto fail;
}
return result;