Commit eb33462a authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

Do not pass uninitialised values to setsockopt(). (fixes #167704)

Original commit message from CVS:
Do not pass uninitialised values to setsockopt(). (fixes #167704)
parent 232ea470
2005-02-17 Luca Ognibene <luogni at tin dot it>
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
* gst/tcp/gsttcpserversink.c: (gst_tcpserversink_init_send):
Don't pass uninitialised values to setsockopt(). (fixes #167704)
2005-02-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybin.c: (add_sink):
......
......@@ -286,16 +286,18 @@ gst_tcpserversink_init_send (GstMultiFdSink * parent)
this->server_sock.fd);
/* make address reusable */
if (setsockopt (this->server_sock.fd, SOL_SOCKET, SO_REUSEADDR, &ret,
sizeof (int)) < 0) {
ret = 1;
if (setsockopt (this->server_sock.fd, SOL_SOCKET, SO_REUSEADDR,
(void *) &ret, sizeof (ret)) < 0) {
gst_tcp_socket_close (&this->server_sock.fd);
GST_ELEMENT_ERROR (this, RESOURCE, SETTINGS, (NULL),
("Could not setsockopt: %s", g_strerror (errno)));
return FALSE;
}
/* keep connection alive; avoids SIGPIPE during write */
if (setsockopt (this->server_sock.fd, SOL_SOCKET, SO_KEEPALIVE, &ret,
sizeof (int)) < 0) {
ret = 1;
if (setsockopt (this->server_sock.fd, SOL_SOCKET, SO_KEEPALIVE,
(void *) &ret, sizeof (ret)) < 0) {
gst_tcp_socket_close (&this->server_sock.fd);
GST_ELEMENT_ERROR (this, RESOURCE, SETTINGS, (NULL),
("Could not setsockopt: %s", g_strerror (errno)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment