summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@ocrete.ca>2014-05-04 01:18:47 -0400
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2014-05-04 01:18:47 -0400
commit587f35ea8e3126c00b6c4e33e67277a60c3d45ba (patch)
tree7ccd55a35c3d365d48d396e4130253eecadd2a2e
parent3aec0fb8ec87299835987266fed208f5267bb000 (diff)
downloadfarstream-587f35ea8e3126c00b6c4e33e67277a60c3d45ba.tar.gz
msnconnection: Double check return value of recv()
Even though it has already been peeked at!
-rw-r--r--gst/fsmsnconference/fs-msn-connection.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gst/fsmsnconference/fs-msn-connection.c b/gst/fsmsnconference/fs-msn-connection.c
index b10619aa..3504dce0 100644
--- a/gst/fsmsnconference/fs-msn-connection.c
+++ b/gst/fsmsnconference/fs-msn-connection.c
@@ -788,7 +788,12 @@ connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd)
if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0)
{
GST_DEBUG ("connection successful");
- recv (pollfd->pollfd.fd, str, 13, 0);
+ if (recv (pollfd->pollfd.fd, str, 13, 0) != 13)
+ {
+ GST_WARNING ("Could not read 13 bytes that had previously"
+ " been peeked at!"):
+ goto error;
+ }
pollfd->status = FS_MSN_STATUS_CONNECTED2;
pollfd->want_write = TRUE;
gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, TRUE);
@@ -830,8 +835,10 @@ connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd)
if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0)
{
GST_DEBUG ("connection successful");
- if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) {
- GST_WARNING ("could not read token");
+ if (recv (pollfd->pollfd.fd, str, 13, 0) != 13)
+ {
+ GST_WARNING ("Could not read 13 bytes that had previously"
+ " been peeked at!"):
goto error;
}