OnDNSFailed on TCPObject unreachable in Win32
by Luke D · in Torque Game Engine · 09/23/2005 (12:02 am) · 1 replies
In 2002 there was a bug where a TCPObject would crash the engine if it attempted to resolve an IP address that didn't exist (see this thread).
The fix prevented crashes from happening, but it neglected to assign the socket to the ConnectedNotifyEvent's tag, which is used by TCPObject::processConnectedNotifyEvent to find the TCPObject in the table in order to pass along the event.
Simply adding the following line:
around line 131 of winNet.cc fixes this problem so onDNSFailed can be properly called.
The fix prevented crashes from happening, but it neglected to assign the socket to the ConnectedNotifyEvent's tag, which is used by TCPObject::processConnectedNotifyEvent to find the TCPObject in the table in order to pass along the event.
Simply adding the following line:
if(error)
{
notifyEvent.state = ConnectedNotifyEvent::DNSFailed;
[b]notifyEvent.tag = temp->socket;[/b]
::closesocket(temp->socket);
}
else
{around line 131 of winNet.cc fixes this problem so onDNSFailed can be properly called.
About the author
Associate Ben Garney
Fix is in 1.4.