Changeset - r11548:de263ab7b3a4
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-04-02 23:03:18
rubidium@openttd.org
(svn r15918) -Fix (r15917): comparing IPs sometimes failed due to 'random' data (as spotted by SpComb)
2 files changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/network/core/udp.cpp
Show inline comments
 
@@ -101,6 +101,8 @@ void NetworkUDPSocketHandler::SendPacket
 
void NetworkUDPSocketHandler::ReceivePackets()
 
{
 
	struct sockaddr_storage client_addr;
 
	memset(&client_addr, 0, sizeof(client_addr));
 

	
 
	socklen_t client_len;
 
	int nbytes;
 
	Packet p(this);
src/network/network.cpp
Show inline comments
 
@@ -480,6 +480,7 @@ static void NetworkAcceptClients()
 
	assert(_listensocket != INVALID_SOCKET);
 

	
 
	for (;;) {
 
		memset(&sin, 0, sizeof(sin));
 
		socklen_t sin_len = sizeof(sin);
 
		SOCKET s = accept(_listensocket, (struct sockaddr*)&sin, &sin_len);
 
		if (s == INVALID_SOCKET) return;
0 comments (0 inline, 0 general)