Use recv instead of read in read_packet_handler
authorVolker Lendecke <vl@samba.org>
Sun, 5 Apr 2009 11:26:42 +0000 (13:26 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 5 Apr 2009 11:45:15 +0000 (13:45 +0200)
This way the socket wrapper pcap file also sees the replies :-)

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;