Remove async_req based async_recv
[kai/samba-autobuild/.git] / lib / async_req / async_sock.c
index 3563421e0e56c62363ab752e55db3ea788db2136..302265c80531098e4d69c139275dce7842f5aa75 100644 (file)
@@ -310,74 +310,6 @@ struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        return result;
 }
 
-/**
- * fde event handler for the "recv" syscall
- * @param[in] ev       The event context that sent us here
- * @param[in] fde      The file descriptor event associated with the recv
- * @param[in] flags    Can only be TEVENT_FD_READ here
- * @param[in] priv     private data, "struct async_req *" in this case
- */
-
-static void async_recv_callback(struct tevent_context *ev,
-                               struct tevent_fd *fde, uint16_t flags,
-                               void *priv)
-{
-       struct async_req *req = talloc_get_type_abort(
-               priv, struct async_req);
-       struct async_syscall_state *state = talloc_get_type_abort(
-               req->private_data, struct async_syscall_state);
-       struct param_recv *p = &state->param.param_recv;
-
-       if (state->syscall_type != ASYNC_SYSCALL_RECV) {
-               async_req_error(req, EIO);
-               return;
-       }
-
-       state->result.result_ssize_t = recv(p->fd, p->buffer, p->length,
-                                           p->flags);
-       state->sys_errno = errno;
-
-       TALLOC_FREE(state->fde);
-
-       async_req_done(req);
-}
-
-/**
- * Async version of recv(2)
- * @param[in] mem_ctx  The memory context to hang the result off
- * @param[in] ev       The event context to work from
- * @param[in] fd       The socket to recv from
- * @param[in] buffer   The buffer to recv into
- * @param[in] length   How many bytes to recv
- * @param[in] flags    flags passed to recv(2)
- *
- * This function is a direct counterpart of recv(2)
- */
-
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
-                            int fd, void *buffer, size_t length,
-                            int flags)
-{
-       struct async_req *result;
-       struct async_syscall_state *state;
-
-       result = async_fde_syscall_new(
-               mem_ctx, ev, ASYNC_SYSCALL_RECV,
-               fd, TEVENT_FD_READ, async_recv_callback,
-               &state);
-
-       if (result == NULL) {
-               return NULL;
-       }
-
-       state->param.param_recv.fd = fd;
-       state->param.param_recv.buffer = buffer;
-       state->param.param_recv.length = length;
-       state->param.param_recv.flags = flags;
-
-       return result;
-}
-
 struct async_send_state {
        int fd;
        const void *buf;