socket_wrapper: don't crash if we get EAGAIN from real_recv()
authorStefan Metzmacher <metze@samba.org>
Tue, 3 Mar 2009 18:20:43 +0000 (19:20 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 4 Mar 2009 07:32:31 +0000 (08:32 +0100)
This fixes a crash in the ldaps tests with socket wrapper pcap support.

metze

lib/socket_wrapper/socket_wrapper.c

index 1e3927705b215ba85bccd05522f4c70540ca9c00..51f37804ef5b986067ac274279819cdc5992ae8a 100644 (file)
@@ -1781,7 +1781,7 @@ _PUBLIC_ ssize_t swrap_recv(int s, void *buf, size_t len, int flags)
                swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0);
        } else if (ret == 0) { /* END OF FILE */
                swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0);
-       } else {
+       } else if (ret > 0) {
                swrap_dump_packet(si, NULL, SWRAP_RECV, buf, ret);
        }