Permalink
Browse files

vnsi: close connection on packet sync error

  • Loading branch information...
1 parent b436146 commit 2d93e7adf5c237ecf75140b6abecb561fb818fda @FernetMenta committed Dec 30, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 addons/pvr.vdr.vnsi/src/VNSISession.cpp
@@ -180,6 +180,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
if (!readData(vresp->getHeader(), vresp->getStreamHeaderLength(), iDatapacketTimeout))
{
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on channel stream packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
vresp->extractStreamHeader();
@@ -196,6 +198,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
{
PVR->FreeDemuxPacket(p);
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on channel stream mux packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
}
@@ -208,6 +212,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
{
free(userData);
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on channel stream (other) packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
}
@@ -219,6 +225,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
if (!readData(vresp->getHeader(), vresp->getOSDHeaderLength(), iDatapacketTimeout))
{
+ XBMC->Log(LOG_ERROR, "%s - lost sync on osd packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
vresp->extractOSDHeader();
@@ -234,6 +242,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
{
free(userData);
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on additional osd packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
}
@@ -246,6 +256,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
if (!readData(vresp->getHeader(), vresp->getHeaderLength(), iDatapacketTimeout))
{
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on response packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
vresp->extractHeader();
@@ -261,6 +273,8 @@ cResponsePacket* cVNSISession::ReadMessage(int iInitialTimeout /*= 10000*/, int
{
free(userData);
delete vresp;
+ XBMC->Log(LOG_ERROR, "%s - lost sync on additional response packet", __FUNCTION__);
+ SignalConnectionLost();
return NULL;
}
}

0 comments on commit 2d93e7a

Please sign in to comment.