]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip server: RTP handle more TCP errors, fixes #4226
authorJaroslav Kysela <perex@perex.cz>
Thu, 3 Aug 2017 07:00:48 +0000 (09:00 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 18 Sep 2017 13:06:45 +0000 (15:06 +0200)
From: Mono Polimorph

src/satip/rtp.c

index 0cdc82ebc367098b3eae895eb86feb7efa2552d3..5679f7ade1c6008600807c61443984c1bd3364f2 100644 (file)
@@ -282,7 +282,7 @@ static inline int
 satip_rtp_flush_tcp_data(satip_rtp_session_t *rtp)
 {
   struct iovec *v = &rtp->tcp_data;
-  int r;
+  int r = 0;
 
   if (v->iov_len)
     r = satip_rtp_tcp_data(rtp, 0, v->iov_base, v->iov_len);
@@ -382,13 +382,13 @@ satip_rtp_thread(void *aux)
     sm = TAILQ_FIRST(&sq->sq_queue);
     if (sm == NULL) {
       if (tcp) {
-        satip_rtp_flush_tcp_data(rtp);
+        r = satip_rtp_flush_tcp_data(rtp);
       } else {
         r = satip_rtp_send(rtp);
-        if (r) {
-          fatal = 1;
-          continue;
-        }
+      }
+      if (r) {
+        fatal = 1;
+        continue;
       }
       tvh_cond_wait(&sq->sq_cond, &sq->sq_mutex);
       continue;