Use recv instead of read in read_packet_handler
[ira/wip.git] / lib / async_req / async_sock.c
index 77df4060449f939fedbc709946cbfb491c89d4d1..39705f45bb251ec6386b3ecaa767da18bb8ffbfc 100644 (file)
@@ -547,7 +547,8 @@ static void read_packet_handler(struct tevent_context *ev,
        ssize_t nread, more;
        uint8_t *tmp;
 
-       nread = read(state->fd, state->buf+state->nread, total-state->nread);
+       nread = recv(state->fd, state->buf+state->nread, total-state->nread,
+                    0);
        if (nread == -1) {
                tevent_req_error(req, errno);
                return;