From 261a025565fb8ad5977c3376a9bebf58239a6e98 Mon Sep 17 00:00:00 2001 From: azw Date: Sat, 19 Aug 2023 15:43:55 +0800 Subject: [PATCH] 1 --- a8/websocketclient.cc | 7 +------ a8/websocketclient.h | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/a8/websocketclient.cc b/a8/websocketclient.cc index 3d08c74..4819003 100644 --- a/a8/websocketclient.cc +++ b/a8/websocketclient.cc @@ -194,7 +194,7 @@ namespace a8 int prev_offset = 0; do { prev_offset = offset; - DecodeUserPacket(decoded_buff_, offset, decoded_bufflen_); + on_decode_userpacket(decoded_buff_, offset, decoded_bufflen_); } while (prev_offset < offset && offset < decoded_bufflen_); if (offset > 0 && offset < decoded_bufflen_){ @@ -292,11 +292,6 @@ namespace a8 } } - void WebSocketClient::DecodeUserPacket(char* buf, int& offset, unsigned int buflen) - { - int i = 0; - } - } #endif diff --git a/a8/websocketclient.h b/a8/websocketclient.h index 91c4c09..6f7d007 100644 --- a/a8/websocketclient.h +++ b/a8/websocketclient.h @@ -20,7 +20,7 @@ namespace a8 std::function on_error; std::function on_connect; std::function on_disconnect; - std::function on_socketread; + std::function on_decode_userpacket; void Open(); void Close(); @@ -30,7 +30,6 @@ namespace a8 private: void DecodePacket(char* buf, int& offset, unsigned int buflen); - void DecodeUserPacket(char* buf, int& offset, unsigned int buflen); void ProcessHandShake(char* buf, int& offset, unsigned int buflen); void ProcessWsHandShake(char* buf, int& offset, unsigned int buflen);