From 619a85cc40ff939471c8327f2605bf433ed90759 Mon Sep 17 00:00:00 2001 From: Connection Refused Date: Wed, 29 Sep 2021 15:56:43 +0800 Subject: [PATCH] [Redirector] Fix missing declaration --- Redirector/EventHandler.cpp | 3 +-- Redirector/EventHandler.h | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) 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