possibly fixed UDPSend error on unix

This commit is contained in:
Lion Kortlepel 2020-11-06 01:58:36 +01:00
parent 775e46788c
commit 3eb2bd0dfc

View File

@ -58,10 +58,14 @@ void UDPSend(Client* c, std::string Data) {
c->SetStatus(-1);
}
#else // unix
if (sendOk != 0) {
if (sendOk == -1) {
debug(Sec("(UDP) Send Failed Code : ") + std::string(strerror(errno)));
if (c->GetStatus() > -1)
c->SetStatus(-1);
} else if (sendOk == 0) {
debug(Sec("(UDP) sendto returned 0"));
if (c->GetStatus() > -1)
c->SetStatus(-1);
}
#endif // WIN32
}