SA-MP Forums Archive
Socket Plugin Crashing Server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Socket Plugin Crashing Server (/showthread.php?tid=622757)



[Solved] Socket Plugin Crashing Server - CoaPsyFactor - 26.11.2016

Код:
Hello,

I have this weird problem with Sockets plugin [https://sampforum.blast.hk/showthread.php?tid=333934]

When I call socket_remote_client_connected on connected id my server crashes - every time.
I checked with CrashDetect plugin it says that socket_remote_client_connected caused server to crash.

If anyone has any help, please provide some :)

Thanks in advance.
I solved it, its bug with plugin, in file CSocket.cpp on line 286 condition is wrong

Код:
if(m_pSocketInfo[socketid].ssl) {
	if(recv(m_pSocketInfo[socketid].connected_clients[remote_clientid], tempbuf, sizeof(tempbuf), NULL) != 0)
		return 1;
}
should be

Код:
if(false == m_pSocketInfo[socketid].ssl) {
	if(recv(m_pSocketInfo[socketid].connected_clients[remote_clientid], tempbuf, sizeof(tempbuf), NULL) != 0)
		return 1;
}