diff --git a/Redirector/EventHandler.cpp b/Redirector/EventHandler.cpp index b9e58260..44100d56 100644 --- a/Redirector/EventHandler.cpp +++ b/Redirector/EventHandler.cpp @@ -299,7 +299,7 @@ void udpSend(ENDPOINT_ID id, const unsigned char* target, const char* buffer, in return; } - PNF_UDP_OPTIONS data = new NF_UDP_OPTIONS(); + auto data = new NF_UDP_OPTIONS(); memcpy(data, options, sizeof(NF_UDP_OPTIONS)); thread(udpBeginReceive, id, conn, data).detach(); @@ -350,7 +350,6 @@ void udpBeginReceive(ENDPOINT_ID id, SocksHelper::PUDP conn, PNF_UDP_OPTIONS dat while (conn->udpSocket != INVALID_SOCKET) { SOCKADDR_IN6 target; - int targetLength = sizeof(SOCKADDR_IN6); int length = conn->Read((PSOCKADDR)&target, buffer, 1458); if (length == 0 || length == SOCKET_ERROR) diff --git a/Redirector/EventHandler.h b/Redirector/EventHandler.h index 7932b5d5..2548ad1e 100644 --- a/Redirector/EventHandler.h +++ b/Redirector/EventHandler.h @@ -3,6 +3,8 @@ #define EVENTHANDLER_H #include "Based.h" +#include "SocksHelper.h" + bool eh_init(); void eh_free(); @@ -23,4 +25,6 @@ void udpCanReceive(ENDPOINT_ID id); void udpReceive(ENDPOINT_ID id, const unsigned char* target, const char* buffer, int length, PNF_UDP_OPTIONS options); void udpClosed(ENDPOINT_ID id, PNF_UDP_CONN_INFO info); +void udpBeginReceive(ENDPOINT_ID id, SocksHelper::PUDP conn, PNF_UDP_OPTIONS data); + #endif