]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tcp: increase timeout for multiple connections (limiting) to 5 seconds, check for...
authorJaroslav Kysela <perex@perex.cz>
Mon, 16 Oct 2017 06:56:36 +0000 (08:56 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 16 Oct 2017 06:56:36 +0000 (08:56 +0200)
src/tcp.c

index ed057812fadf673cbbe59d1a0521a80fcf986953..e0ccd0f82e8702bb90ed01d55e8867c2fcb50d3c 100644 (file)
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -563,7 +563,7 @@ try_again:
     c2 = aa->aa_conn_limit_streaming ? used >= aa->aa_conn_limit_streaming : -1;
 
     if (c1 && c2) {
-      if (started + sec2mono(3) < mclk()) {
+      if (started + sec2mono(5) < mclk()) {
         tvherror(LS_TCP, "multiple connections are not allowed for user '%s' from '%s' "
                         "(limit %u, streaming limit %u, active streaming %u, DVR %u)",
                  aa->aa_username ?: "", aa->aa_representative ?: "",
@@ -574,7 +574,7 @@ try_again:
       pthread_mutex_unlock(&global_lock);
       tvh_safe_usleep(250000);
       pthread_mutex_lock(&global_lock);
-      if (tvheadend_is_running())
+      if (!tcp_socket_dead(fd) && tvheadend_is_running())
         goto try_again;
       return NULL;
     }