summaryrefslogtreecommitdiff
path: root/lib/async_req/async_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/async_req/async_sock.c')
-rw-r--r--lib/async_req/async_sock.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 1f48697f26..424da952eb 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -123,8 +123,8 @@ static void async_send_handler(struct tevent_context *ev,
{
struct tevent_req *req = talloc_get_type_abort(
private_data, struct tevent_req);
- struct async_send_state *state = talloc_get_type_abort(
- req->private_state, struct async_send_state);
+ struct async_send_state *state =
+ tevent_req_data(req, struct async_send_state);
state->sent = send(state->fd, state->buf, state->len, state->flags);
if (state->sent == -1) {
@@ -136,8 +136,8 @@ static void async_send_handler(struct tevent_context *ev,
ssize_t async_send_recv(struct tevent_req *req, int *perrno)
{
- struct async_send_state *state = talloc_get_type_abort(
- req->private_state, struct async_send_state);
+ struct async_send_state *state =
+ tevent_req_data(req, struct async_send_state);
if (tevent_req_is_unix_error(req, perrno)) {
return -1;
@@ -189,8 +189,8 @@ static void async_recv_handler(struct tevent_context *ev,
{
struct tevent_req *req = talloc_get_type_abort(
private_data, struct tevent_req);
- struct async_recv_state *state = talloc_get_type_abort(
- req->private_state, struct async_recv_state);
+ struct async_recv_state *state =
+ tevent_req_data(req, struct async_recv_state);
state->received = recv(state->fd, state->buf, state->len,
state->flags);
@@ -203,8 +203,8 @@ static void async_recv_handler(struct tevent_context *ev,
ssize_t async_recv_recv(struct tevent_req *req, int *perrno)
{
- struct async_recv_state *state = talloc_get_type_abort(
- req->private_state, struct async_recv_state);
+ struct async_recv_state *state =
+ tevent_req_data(req, struct async_recv_state);
if (tevent_req_is_unix_error(req, perrno)) {
return -1;
@@ -317,8 +317,8 @@ static void async_connect_connected(struct tevent_context *ev,
{
struct tevent_req *req = talloc_get_type_abort(
priv, struct tevent_req);
- struct async_connect_state *state = talloc_get_type_abort(
- req->private_state, struct async_connect_state);
+ struct async_connect_state *state =
+ tevent_req_data(req, struct async_connect_state);
TALLOC_FREE(fde);
@@ -352,8 +352,8 @@ static void async_connect_connected(struct tevent_context *ev,
int async_connect_recv(struct tevent_req *req, int *perrno)
{
- struct async_connect_state *state = talloc_get_type_abort(
- req->private_state, struct async_connect_state);
+ struct async_connect_state *state =
+ tevent_req_data(req, struct async_connect_state);
int err;
fcntl(state->fd, F_SETFL, state->old_sockflags);
@@ -420,8 +420,8 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde,
{
struct tevent_req *req = talloc_get_type_abort(
private_data, struct tevent_req);
- struct writev_state *state = talloc_get_type_abort(
- req->private_state, struct writev_state);
+ struct writev_state *state =
+ tevent_req_data(req, struct writev_state);
size_t to_write, written;
int i;
@@ -467,8 +467,8 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde,
ssize_t writev_recv(struct tevent_req *req, int *perrno)
{
- struct writev_state *state = talloc_get_type_abort(
- req->private_state, struct writev_state);
+ struct writev_state *state =
+ tevent_req_data(req, struct writev_state);
if (tevent_req_is_unix_error(req, perrno)) {
return -1;
@@ -531,8 +531,8 @@ static void read_packet_handler(struct tevent_context *ev,
{
struct tevent_req *req = talloc_get_type_abort(
private_data, struct tevent_req);
- struct read_packet_state *state = talloc_get_type_abort(
- req->private_state, struct read_packet_state);
+ struct read_packet_state *state =
+ tevent_req_data(req, struct read_packet_state);
size_t total = talloc_get_size(state->buf);
ssize_t nread, more;
uint8_t *tmp;
@@ -584,8 +584,8 @@ static void read_packet_handler(struct tevent_context *ev,
ssize_t read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
uint8_t **pbuf, int *perrno)
{
- struct read_packet_state *state = talloc_get_type_abort(
- req->private_state, struct read_packet_state);
+ struct read_packet_state *state =
+ tevent_req_data(req, struct read_packet_state);
if (tevent_req_is_unix_error(req, perrno)) {
return -1;