From: Tim-Philipp Müller Date: Sat, 4 Apr 2015 20:38:40 +0000 (+0100) Subject: tcpserversink: don't error out if clients send us something, just ignore it X-Git-Tag: 1.6.0~394 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6db2ee56b6e862f54c479e553f179daf2056da74;p=platform%2Fupstream%2Fgst-plugins-base.git tcpserversink: don't error out if clients send us something, just ignore it We don't expect clients to send us any data, but if they do, just ignore it. Web browsers might send us an HTTP request for example, but some will still be happy if we just send them data without a proper HTTP response. There was a bug in the reading code path. We only have a small read buffer and would provoke an EWOULDBLOCK trying to read because we don't bail out of the loop early enough. https://bugzilla.gnome.org/show_bug.cgi?id=743834 --- diff --git a/gst/tcp/gstmultisocketsink.c b/gst/tcp/gstmultisocketsink.c index 22a7e33..aed9808 100644 --- a/gst/tcp/gstmultisocketsink.c +++ b/gst/tcp/gstmultisocketsink.c @@ -575,7 +575,7 @@ gst_multi_socket_sink_handle_client_read (GstMultiSocketSink * sink, GST_DEBUG_OBJECT (sink, "%s client wants us to read", mhclient->debug); navail = g_socket_get_available_bytes (mhclient->handle.socket); - if (navail < 0) + if (navail <= 0) break; nread =