mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
[Redirector] Add DNS timeout
This commit is contained in:
@@ -23,7 +23,10 @@ void ProcessPacket(ENDPOINT_ID id, SOCKADDR_IN6 target, char* packet, int length
|
||||
{
|
||||
if (udpConn.Send(&dnsAddr, packet, length) == length)
|
||||
{
|
||||
int size = udpConn.Read(NULL, buffer, sizeof(buffer));
|
||||
timeval timeout;
|
||||
timeout.tv_sec = 4;
|
||||
|
||||
int size = udpConn.Read(NULL, buffer, sizeof(buffer), &timeout);
|
||||
if (size != 0 && size != SOCKET_ERROR)
|
||||
{
|
||||
nf_udpPostReceive(id, (unsigned char*)&target, buffer, size, option);
|
||||
|
||||
Reference in New Issue
Block a user