Skip to content

Commit

Permalink
event/ServerSocket: do not close all listeners before rethrowing
Browse files Browse the repository at this point in the history
If binding one address fails, we don't need to close all listeners.
For fatal errors, this will be done automatically and implicitly; and
for non-fatal errors (e.g. binding to the default port failed, but
there is an XDG listener), this closes the good listeners which are
supposed to be used.

Closes #2157
  • Loading branch information
MaxKellermann committed Dec 4, 2024
1 parent b6e187e commit 9a8579d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/event/ServerSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ ServerSocket::Open()
continue;

if (bad != nullptr && i.GetSerial() != bad->GetSerial()) {
Close();
std::rethrow_exception(last_error);
}

Expand Down Expand Up @@ -257,7 +256,6 @@ ServerSocket::Open()
}

if (bad != nullptr) {
Close();
std::rethrow_exception(last_error);
}
}
Expand Down

0 comments on commit 9a8579d

Please sign in to comment.