X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ftcp.c;h=2198e0f00e28f58269c6714e2a7815d27105bb5d;hb=e5bcda6473a2d6984216004506374669501fcf3b;hp=ea41f2e9868b0ae2b48ed3caaa538c9f791b2041;hpb=c7488f746154b5dcd70f8a3bef9a9fa5c42ac595;p=ffmpeg diff --git a/libavformat/tcp.c b/libavformat/tcp.c index ea41f2e9868..2198e0f00e2 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -76,17 +76,25 @@ static void customize_fd(void *ctx, int fd) /* Set the socket's send or receive buffer sizes, if specified. If unspecified or setting fails, system default is used. */ if (s->recv_buffer_size > 0) { - setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &s->recv_buffer_size, sizeof (s->recv_buffer_size)); + if (setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &s->recv_buffer_size, sizeof (s->recv_buffer_size))) { + ff_log_net_error(ctx, AV_LOG_WARNING, "setsockopt(SO_RCVBUF)"); + } } if (s->send_buffer_size > 0) { - setsockopt (fd, SOL_SOCKET, SO_SNDBUF, &s->send_buffer_size, sizeof (s->send_buffer_size)); + if (setsockopt (fd, SOL_SOCKET, SO_SNDBUF, &s->send_buffer_size, sizeof (s->send_buffer_size))) { + ff_log_net_error(ctx, AV_LOG_WARNING, "setsockopt(SO_SNDBUF)"); + } } if (s->tcp_nodelay > 0) { - setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &s->tcp_nodelay, sizeof (s->tcp_nodelay)); + if (setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &s->tcp_nodelay, sizeof (s->tcp_nodelay))) { + ff_log_net_error(ctx, AV_LOG_WARNING, "setsockopt(TCP_NODELAY)"); + } } #if !HAVE_WINSOCK2_H if (s->tcp_mss > 0) { - setsockopt (fd, IPPROTO_TCP, TCP_MAXSEG, &s->tcp_mss, sizeof (s->tcp_mss)); + if (setsockopt (fd, IPPROTO_TCP, TCP_MAXSEG, &s->tcp_mss, sizeof (s->tcp_mss))) { + ff_log_net_error(ctx, AV_LOG_WARNING, "setsockopt(TCP_MAXSEG)"); + } } #endif /* !HAVE_WINSOCK2_H */ }