Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: svdrp - Bug or Feature or my fault



Wolfgang Goeller wrote:
> 
> Klaus Schmidinger wrote:
> 
> >>The only difference I see is in line 1103 - in svdrp.c - should
> >>this be "reverted"?
> >
> >
> > Yes, please try that. The diff between version 1.2.1 and 1.2.2 was
> >
> > --- svdrp.c     2003/06/06 13:30:52     1.52
> > +++ svdrp.c     2003/07/26 10:57:33     1.53
> > @@ -1100,7 +1100,7 @@
> >                   }
> >                lastActivity = time(NULL);
> >                }
> > -           else if (r <= 0) {
> > +           else if (r < 0) {
> >                isyslog("lost connection to SVDRP client");
> >                Close();
> >                }
> 
> After a closer look I think, the old version is better
>    else if (r <= 0)
> 
> reason 1: Otherwise it is undefined, what to do with r == 0
> reason 2: The old version works reliable. Nothing went wrong
> in the last 15 hours.
> 
> Might be there is a reason for the new version of svdrp.c
> But in that case a test for r == 0 should be inserted.
> 
> regards
> Wolfgang

Apparently, when the client somehow gets lost without explicitly
sending QUIT, the file.Ready() call in the 'while' loop of cSVDRP::Process()
always returns 'true', but there is no actual data to read. That's why
the loop hangs in that case. The older code terminated the connection
once this situation occured, but Gerhard Steiner had reported problems
with that in the thread http://linuxtv.org/mailinglists/vdr/2003/07-2003/msg00254.html,
so just going back to the old version would only have brought that back, I guess.

After adding the following two lines, this situation no longer blocks VDR,
and the connection is cancelled after the usual SVDRP timeout:

--- svdrp.c     2003/07/26 10:57:33     1.53
+++ svdrp.c     2003/08/30 09:35:00
@@ -1104,6 +1104,8 @@
               isyslog("lost connection to SVDRP client");
               Close();
               }
+           else
+              break;
            }
      if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) {
         isyslog("timeout on SVDRP connection");


Please test this and let me know if it works.

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index