Skip to content

Commit

Permalink
Merge pull request #468 from ksooo/withdraw-v7.1.2
Browse files Browse the repository at this point in the history
7.1.3: Withdraw v7.1.2
  • Loading branch information
ksooo authored Aug 24, 2020
2 parents ba5ca7f + da3d16a commit 7d8efa8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pvr.hts/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.hts"
version="7.1.2"
version="7.1.3"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp, Kai Sommerfeld">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
7.1.3
- Withdraw v7.1.2 due to new deadlocks it introduces, for example during initial connect to backend.

7.1.2
- Fix deadlock while reconnecting to backend after a backend response timeout (Fixes #465)

Expand Down
16 changes: 7 additions & 9 deletions src/tvheadend/HTSPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ void HTSPConnection::Register()
std::string pass = Settings::GetInstance().GetPassword();

{
CLockObject lock(m_mutex);

/* Send Greeting */
Logger::Log(LogLevel::LEVEL_DEBUG, "sending hello");
if (!SendHello())
Expand All @@ -579,6 +581,7 @@ void HTSPConnection::Register()

/* Send Auth */
Logger::Log(LogLevel::LEVEL_DEBUG, "sending auth");

if (!SendAuth(user, pass))
{
SetState(PVR_CONNECTION_STATE_ACCESS_DENIED);
Expand All @@ -592,19 +595,15 @@ void HTSPConnection::Register()

Logger::Log(LogLevel::LEVEL_DEBUG, "registered");
SetState(PVR_CONNECTION_STATE_CONNECTED);

{
CLockObject lock(m_mutex);
m_ready = true;
m_regCond.Broadcast();
}
m_ready = true;
m_regCond.Broadcast();
return;
}

fail:
if (!m_suspended)
{
/* Don't immediately reconnect (spare server CPU cycles) */
/* Don't immediately reconnect (spare server CPU cycles)*/
Sleep(SLOW_RECONNECT_INTERVAL);
Disconnect();
}
Expand Down Expand Up @@ -633,6 +632,7 @@ void* HTSPConnection::Process()
if (m_socket)
delete m_socket;

m_connListener.Disconnected();
m_socket = new CTcpSocket(host.c_str(), port);
m_ready = false;
m_seq = 0;
Expand All @@ -643,8 +643,6 @@ void* HTSPConnection::Process()
}
}

m_connListener.Disconnected();

while (m_suspended)
{
Logger::Log(LogLevel::LEVEL_DEBUG, "suspended. Waiting for wakeup...");
Expand Down

0 comments on commit 7d8efa8

Please sign in to comment.