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 https://github.com/MusicPlayerDaemon/MPD/pull/2157
This commit is contained in:
@ -216,7 +216,6 @@ ServerSocket::Open()
|
||||
continue;
|
||||
|
||||
if (bad != nullptr && i.GetSerial() != bad->GetSerial()) {
|
||||
Close();
|
||||
std::rethrow_exception(last_error);
|
||||
}
|
||||
|
||||
@ -257,7 +256,6 @@ ServerSocket::Open()
|
||||
}
|
||||
|
||||
if (bad != nullptr) {
|
||||
Close();
|
||||
std::rethrow_exception(last_error);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user