diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-05 15:18:19 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-05 15:18:19 +0100 |
commit | 015b269c21fa5ffd6923db3ea5a7a293106338e0 (patch) | |
tree | 8686a7582a0865a7e2439fa473fe7e2f17c06699 /svdrp.c | |
parent | 802544662dc969f46b4863006c35fb498c3d6689 (diff) | |
download | vdr-015b269c21fa5ffd6923db3ea5a7a293106338e0.tar.gz vdr-015b269c21fa5ffd6923db3ea5a7a293106338e0.tar.bz2 |
Making sure cSVDRPClient::Process() reads the entire reply once it started reading, even if no Response parameter is given
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 4.23 2017/11/11 12:04:17 kls Exp $ + * $Id: svdrp.c 4.24 2018/02/05 14:52:27 kls Exp $ */ #include "svdrp.h" @@ -425,11 +425,8 @@ bool cSVDRPClient::Process(cStringList *Response) // make sure the string is terminated: input[numChars] = 0; dbgsvdrp("< %s: %s\n", *serverName, input); - if (Response) { + if (Response) Response->Append(strdup(input)); - if (numChars >= 4 && input[3] != '-') // no more lines will follow - break; - } else { switch (atoi(input)) { case 220: if (numChars > 4) { @@ -448,6 +445,8 @@ bool cSVDRPClient::Process(cStringList *Response) break; } } + if (numChars >= 4 && input[3] != '-') // no more lines will follow + break; numChars = 0; } else { @@ -467,12 +466,12 @@ bool cSVDRPClient::Process(cStringList *Response) return false; } } - else if (!Response) - break; else if (Timeout.TimedOut()) { esyslog("SVDRP < %s timeout while waiting for response from '%s'", ipAddress.Connection(), *serverName); return false; } + else if (!Response && numChars == 0) + break; // we read all or nothing! } if (pingTime.TimedOut()) Execute("PING"); |