OSDN Git Service

sdp: Check correct number of bytes received in recv
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Tue, 17 Sep 2013 14:40:20 +0000 (17:40 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 19 Sep 2013 03:09:52 +0000 (22:09 -0500)
Instead of checking for error check that correct number of bytes received.

src/sdpd-server.c

index 181d248..7b1351f 100644 (file)
@@ -177,7 +177,7 @@ static gboolean io_session_event(GIOChannel *chan, GIOCondition cond, gpointer d
                return TRUE;
 
        len = recv(sk, buf, size, 0);
-       if (len <= 0) {
+       if (len != size) {
                sdp_svcdb_collect_all(sk);
                free(buf);
                return FALSE;