From 8d0ac5e461ae0ddcbd5cfd76d3dfbd5aa372ad39 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 20 Jun 2010 09:11:55 +0200 Subject: fixed file descriptor handling when SVDRP is broken --- HISTORY | 3 +++ HISTORY.DE | 2 ++ svdrpclient.h | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/HISTORY b/HISTORY index 8461e8e..6125b24 100644 --- a/HISTORY +++ b/HISTORY @@ -134,6 +134,9 @@ fixes: patch and to Stefan Bauer for pointing me to it. - fix a crash when toggling between with/without subtitle in timer info view for events that have (very) long "short" texts, thanks to Ville Skyttä for providing a patch. +- fixed file descriptor handling when there are errors in SVDRP communication, thanks to + Teemu Rantanen for providing a patch. + 2008-04-29: Version 0.9.24 new: diff --git a/HISTORY.DE b/HISTORY.DE index caf4239..70b06b7 100644 --- a/HISTORY.DE +++ b/HISTORY.DE @@ -142,6 +142,8 @@ fixes: den Patch und an Stefan Bauer für den Hinweis darauf. - Fix für einen Absturz beim Hin- und Herschalten von mit/ohne Untertitel bei Timern mit mit sehr langen Episodennamen, Danke an Ville Skyttä für den Patch. +- Korrektur beim file descriptor handling bei fehlerhafter SVDRP-Verbindung, Danke an + Teemu Rantanen für einen Patch. 2008-04-29: Version 0.9.24 diff --git a/svdrpclient.h b/svdrpclient.h index da16ee4..bd5771d 100644 --- a/svdrpclient.h +++ b/svdrpclient.h @@ -62,6 +62,12 @@ public: LogFile.eSysLog("EPGSearch: could not connect to VDR!"); } + ~cSVDRPClient() + { + if (sock >= 0) + close(sock); + } + bool SendCmd(const char* cmd) { if (!bConnected) @@ -79,6 +85,7 @@ public: LogFile.eSysLog("could not disconnect (%ld)!", rc); close(sock); + sock = -1; return cmdret; } bool Send(const char* szSend) @@ -112,6 +119,7 @@ public: if (recv(sock, &ch, 1, 0 ) < 0) { LogFile.eSysLog("EPGSearch: error receiving response!"); + free(csResp); return -1; } char* Temp = NULL; -- cgit v1.2.3