sdp: Check for correct pkt size received instead of error

Check that the full header is received in recv().
This commit is contained in:
Andrei Emeltchenko 2013-10-01 14:57:34 +03:00 committed by Johan Hedberg
parent fd8d0713e8
commit 15954a450e

View File

@ -166,7 +166,7 @@ static gboolean io_session_event(GIOChannel *chan, GIOCondition cond, gpointer d
}
len = recv(sk, &hdr, sizeof(sdp_pdu_hdr_t), MSG_PEEK);
if (len <= 0) {
if (len != sizeof(sdp_pdu_hdr_t)) {
sdp_svcdb_collect_all(sk);
return FALSE;
}