Skip to content

Commit

Permalink
MPD: reset connection on disconnect entry
Browse files Browse the repository at this point in the history
  • Loading branch information
bretello committed Dec 16, 2024
1 parent 13071cf commit 7d222db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/mpd/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ bool Idle::on_io(Glib::IOCondition const&) {
ctx_->checkErrors(conn);
} catch (std::exception const& e) {
spdlog::warn("mpd: Idle: error: {}", e.what());
ctx_->connection().reset();
ctx_->setState(std::make_unique<Disconnected>(ctx_));
return false;
}
Expand Down Expand Up @@ -384,6 +385,7 @@ bool Disconnected::on_timer() {
return false; // do not rearm timer
}
} catch (std::exception const& e) {
ctx_->connection().reset();
spdlog::warn("mpd: Disconnected: error: {}", e.what());
}

Expand Down

0 comments on commit 7d222db

Please sign in to comment.