mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 02:30:54 +00:00
log any and every time we closesocket
This commit is contained in:
@@ -347,6 +347,7 @@ int lua_dropPlayer(lua_State* L) {
|
||||
}
|
||||
Respond(c, "C:Server:You have been Kicked from the server! " + Reason, true);
|
||||
c->SetStatus(-2);
|
||||
info(Sec("Closing socket due to kick"));
|
||||
closesocket(c->GetTCPSock());
|
||||
|
||||
} else
|
||||
|
||||
@@ -32,6 +32,7 @@ void STCPSend(Client* c, std::string Data) {
|
||||
} else if (BytesSent < 0) {
|
||||
if (c->GetStatus() > -1)
|
||||
c->SetStatus(-1);
|
||||
info(Sec("Closing socket, BytesSent < 0"));
|
||||
closesocket(c->GetTCPSock());
|
||||
}
|
||||
}
|
||||
@@ -106,11 +107,13 @@ bool STCPRecv(Client* c) {
|
||||
if (BytesRcv == 0) {
|
||||
if (c->GetStatus() > -1)
|
||||
c->SetStatus(-1);
|
||||
info(Sec("Closing socket in STCP receive, BytesRcv == 0"));
|
||||
closesocket(c->GetTCPSock());
|
||||
return false;
|
||||
} else if (BytesRcv < 0) {
|
||||
if (c->GetStatus() > -1)
|
||||
c->SetStatus(-1);
|
||||
info(Sec("Closing socket in STCP receive, BytesRcv < 0"));
|
||||
closesocket(c->GetTCPSock());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ void TCPSend(Client*c,const std::string&Data){
|
||||
return;
|
||||
} else if (Temp < 0) {
|
||||
if (c->GetStatus() > -1)c->SetStatus(-1);
|
||||
info(Sec("Closing socket, Temp < 0"));
|
||||
closesocket(c->GetTCPSock());
|
||||
return;
|
||||
}
|
||||
@@ -49,6 +50,7 @@ bool CheckBytes(Client*c,int32_t BytesRcv){
|
||||
debug(Sec("(TCP) recv failed with error: ") + std::string(strerror(errno)));
|
||||
#endif // WIN32
|
||||
if(c->GetStatus() > -1)c->SetStatus(-1);
|
||||
info(Sec("Closing socket in CheckBytes, BytesRcv < 0"));
|
||||
closesocket(c->GetTCPSock());
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user