[Redirector] Optimize code

This commit is contained in:
Connection Refused
2021-10-04 19:04:03 +08:00
parent 16d4d07b3b
commit 3516745bff
2 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ extern USHORT dnsPort;
SOCKADDR_IN6 dnsAddr;
void ProcessPacket(ENDPOINT_ID id, SOCKADDR_IN6 target, const char* packet, int length, PNF_UDP_OPTIONS options)
void ProcessPacket(ENDPOINT_ID id, SOCKADDR_IN6 target, char* packet, int length, PNF_UDP_OPTIONS option)
{
char buffer[1024];
@@ -26,7 +26,7 @@ void ProcessPacket(ENDPOINT_ID id, SOCKADDR_IN6 target, const char* packet, int
int size = udpConn.Read(NULL, buffer, sizeof(buffer));
if (size != 0 && size != SOCKET_ERROR)
{
nf_udpPostReceive(id, (unsigned char*)&target, buffer, size, options);
nf_udpPostReceive(id, (unsigned char*)&target, buffer, size, option);
}
}
}
@@ -35,7 +35,7 @@ void ProcessPacket(ENDPOINT_ID id, SOCKADDR_IN6 target, const char* packet, int
}
delete[] packet;
delete[] options;
delete[] option;
}
bool DNSHandler::Init()

View File

@@ -10,7 +10,7 @@ namespace DNSHandler
bool IsDNS(PSOCKADDR_IN6 target);
void CreateHandler(ENDPOINT_ID id, PSOCKADDR_IN6 target, const char* packet, int length, PNF_UDP_OPTIONS options);
void CreateHandler(ENDPOINT_ID id, PSOCKADDR_IN6 target, char* packet, int length, PNF_UDP_OPTIONS options);
}
#endif