Skip to content

Commit 9a8579d

Browse files
committed
event/ServerSocket: do not close all listeners before rethrowing
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
1 parent b6e187e commit 9a8579d

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/event/ServerSocket.cxx

-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ ServerSocket::Open()
216216
continue;
217217

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

@@ -257,7 +256,6 @@ ServerSocket::Open()
257256
}
258257

259258
if (bad != nullptr) {
260-
Close();
261259
std::rethrow_exception(last_error);
262260
}
263261
}

0 commit comments

Comments
 (0)