From 08da3d9f9641cfc56fc0fb7e7dc0f949d8ee138b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 17 Oct 2013 11:49:02 +0300 Subject: [PATCH] Revert "unit/sdp: Check that correct packet received in recv" This reverts commit b9981c4fa197e79f7ecd480fd9fbfa3601d121a1. Some tests have intentionally incorrect PDU lengths, so trying to be strict in the check is wrong. --- unit/test-sdp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unit/test-sdp.c b/unit/test-sdp.c index 4726b8bd2..6d699e2f8 100644 --- a/unit/test-sdp.c +++ b/unit/test-sdp.c @@ -145,7 +145,8 @@ static gboolean server_handler(GIOChannel *channel, GIOCondition cond, struct context *context = user_data; sdp_pdu_hdr_t hdr; void *buf; - ssize_t len, size; + size_t size; + ssize_t len; int fd; fd = g_io_channel_unix_get_fd(channel); @@ -168,7 +169,7 @@ static gboolean server_handler(GIOChannel *channel, GIOCondition cond, return TRUE; len = recv(fd, buf, size, 0); - if (len != size) { + if (len <= 0) { sdp_svcdb_collect_all(fd); free(buf); return FALSE; -- 2.11.0