Mailing List archive

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

[vdr] Re: Feature request: changed/new SVDRP return codes



On Thu, Feb 05, 2004 at 09:47:14PM +0100, Matthias Schniedermeyer wrote:
> On Thu, Feb 05, 2004 at 10:30:44PM +0200, Jan Ekholm wrote:
> > 
> > Hi,
> > 
> > While looking a bit at parsing the SVDRP data that VDR returns I think a
> > small change or two to the protocol could make things a lot easier for
> > those using the protocol.
> > 
> > Currently most commands that get lists of stuff from VDR are using the
> > return code 250, which means "Requested VDR action okay, completed". It
> > can however be a bit hard to parse the data from VDR as this 250 is used
> > for so many things. Imagine the following:
> > 
> > 1. client sends a LSTC
> > 2. reads lines from VDR and parses the channels
> > 3. client sends a LSTR
> > 4. reads lines from VDR and parses the recordings
> > 
> > However, when can the client know for sure that all data that the LSTC
> > generates has been read and it is safe to send to LSTR? Timeouts are a bit
> > of an ugly hack. Most likely VDR has sent all data when the client hasn't
> > got anything for, say, 10 seconds, but one can't be really sure. It is
> > quite easy to mix up the lines returned by the various commands that use
> > 250 and do a mis-parse.
> 
> The last "250" has a " " instead of the "-"
> 
> 250-Bla
> 250-Bla
> 250-Bla
> 250 <- Here is the space = last line

To be more precise.
A dash after 3 digits says that there is another line.

e.g. This is the loop that Master-Timer uses for getting the result of a
sended command.

- snip -
    print $socket "$command\r\n";
    while (<$socket>) {
      s/\x0d//g;
      push (@retval, $_);
      last if (!/^\d{3,3}-/);
    }
- snip -
->
"Leave the loop if the line doesn't begin with 3 digits and a dash".

This has never been other.



Bis denn

-- 
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.



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



Home | Main Index | Thread Index