Skip to content

Commit

Permalink
Break the connection loop on connection failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Jul 29, 2024
1 parent 8797e03 commit f799dee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xtransmit/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void common_run(const vector<string>& urls, const stats_config& cfg_stats, const
steady_clock::time_point next_reconnect = steady_clock::now();

concurrent_pipes pipes(stats.get());
unsigned conns_cnt = 0;
int conns_cnt = 0;

do {
const auto tstart = steady_clock::now();
Expand Down Expand Up @@ -246,6 +246,7 @@ void common_run(const vector<string>& urls, const stats_config& cfg_stats, const
catch (const socket::exception& e)
{
spdlog::warn(LOG_SC_CONN "{}", e.what());
break;
}

if (cfg_conn.max_conns > 0 && conns_cnt >= cfg_conn.max_conns)
Expand Down

0 comments on commit f799dee

Please sign in to comment.