[MPlayer-dev-eng] [PATCH] set tcp connection retries in standard http connection
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Mon Feb 21 19:20:54 CET 2011
On Mon, Feb 21, 2011 at 11:02:40AM +0600, Andrei Katsuk wrote:
> Hi.
>
> The attached patch makes it possible to change the number of tcp
> connection retries in in standard http connection (stream/tcp.c).
> It's useful to reduce time delay in connection mode.
> The command option for this feature is "tcp-connect-retries"
> Index: stream/tcp.c
> ===================================================================
> --- stream/tcp.c (revision 32945)
> +++ stream/tcp.c (working copy)
> @@ -53,6 +53,7 @@
>
> /* IPv6 options */
> int network_prefer_ipv4 = 0;
> +int tcp_connect_retries = 30;
>
> // Converts an address family constant to a string
>
> @@ -218,8 +219,8 @@
> FD_SET( socket_server_fd, &set );
> // When the connection will be made, we will have a writeable fd
> while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) {
> - if(count > 30 || stream_check_interrupt(500)) {
> - if(count > 30)
> + if(count > tcp_connect_retries || stream_check_interrupt(500)) {
> + if(count > tcp_connect_retries)
Huh? That is no retry count, the connection is opened only once.
This is a connection timeout.
And in addition like this it is in 500ms units, that is not very convenient.
More information about the MPlayer-dev-eng
mailing list