Permalink
Browse files

[tvheadend] check for errors in CHTSPConnection::ReadResult. issue #131

  • Loading branch information...
opdenkamp authored and zeroniak committed Dec 30, 2012
1 parent f2c8f70 commit c4448d3cc6d67451aed81e4c5b7c927e6131c499
Showing with 21 additions and 0 deletions.
  1. +21 −0 addons/pvr.hts/src/HTSPConnection.cpp
@@ -377,6 +377,27 @@ void CHTSPConnection::ReadResult(htsmsg_t *m, CHTSResult &result, const char* st
{
// response received
result.message = message.msg;
+
+ if (result.NoAccess())
+ {
+ // access denied
+ if (strAction)
+ XBMC->Log(LOG_ERROR, "%s - '%s' failed - access denied", __FUNCTION__, strAction);
+ else
+ XBMC->Log(LOG_ERROR, "%s - command failed - access denied", __FUNCTION__);
+ result.status = PVR_ERROR_REJECTED;
+ }
+
+ if (result.IsError())
+ {
+ // server reported an error
+ string strError = result.GetErrorMessage();
+ if (strAction)
+ XBMC->Log(LOG_ERROR, "%s - '%s' failed - %s", __FUNCTION__, strAction, strError.c_str());
+ else
+ XBMC->Log(LOG_ERROR, "%s - command failed - %s", __FUNCTION__, strError.c_str());
+ result.status = PVR_ERROR_REJECTED;
+ }
}
// delete from the queue

0 comments on commit c4448d3

Please sign in to comment.