event/ServerSocket: allow mixing AddFD() with other Add*() methods

This commit is contained in:
Max Kellermann 2018-10-30 20:36:42 +01:00
parent dd8e14e121
commit 64da9399ca

View File

@ -207,6 +207,11 @@ ServerSocket::Open()
assert(i.GetSerial() > 0); assert(i.GetSerial() > 0);
assert(good == nullptr || i.GetSerial() >= good->GetSerial()); assert(good == nullptr || i.GetSerial() >= good->GetSerial());
if (i.IsDefined())
/* already open - was probably added by
AddFD() */
continue;
if (bad != nullptr && i.GetSerial() != bad->GetSerial()) { if (bad != nullptr && i.GetSerial() != bad->GetSerial()) {
Close(); Close();
std::rethrow_exception(last_error); std::rethrow_exception(last_error);