From aeda47ec8c653b466d42542c6defc69296246099 Mon Sep 17 00:00:00 2001 From: sandro-qiang <44429952+sandro-qiang@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:33:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3SctpAssociation.cpp=E7=9A=84?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E8=B6=8A=E7=95=8C=20(#3182)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZLMediaKit/ZLMediaKit#3181 --- CMakeLists.txt | 2 +- webrtc/SctpAssociation.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64157b7f..96e79890 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,7 +370,7 @@ if(ENABLE_JEMALLOC_STATIC) set(ENABLE_JEMALLOC_STAT OFF) endif () include(Jemalloc) - include_directories(SYSTEM ${DEP_ROOT_DIR}/${JEMALLOC_NAME}/include/jemalloc) + include_directories(SYSTEM ${DEP_ROOT_DIR}/${JEMALLOC_NAME}/include) link_directories(${DEP_ROOT_DIR}/${JEMALLOC_NAME}/lib) # 用于影响后续查找过程 # Used to affect subsequent lookup process diff --git a/webrtc/SctpAssociation.cpp b/webrtc/SctpAssociation.cpp index 84a2c04f..1b5d2782 100644 --- a/webrtc/SctpAssociation.cpp +++ b/webrtc/SctpAssociation.cpp @@ -677,9 +677,9 @@ namespace RTC if (notification->sn_header.sn_length > 0) { static const size_t BufferSize{ 1024 }; - static char buffer[BufferSize]; + thread_local static char buffer[BufferSize]; - uint32_t len = notification->sn_header.sn_length; + uint32_t len = notification->sn_assoc_change.sac_length - sizeof(struct sctp_assoc_change); for (uint32_t i{ 0 }; i < len; ++i) { @@ -745,9 +745,9 @@ namespace RTC if (notification->sn_header.sn_length > 0) { static const size_t BufferSize{ 1024 }; - static char buffer[BufferSize]; + thread_local static char buffer[BufferSize]; - uint32_t len = notification->sn_header.sn_length; + uint32_t len = notification->sn_assoc_change.sac_length - sizeof(struct sctp_assoc_change); for (uint32_t i{ 0 }; i < len; ++i) { @@ -786,7 +786,7 @@ namespace RTC case SCTP_REMOTE_ERROR: { static const size_t BufferSize{ 1024 }; - static char buffer[BufferSize]; + thread_local static char buffer[BufferSize]; uint32_t len = notification->sn_remote_error.sre_length - sizeof(struct sctp_remote_error); @@ -822,7 +822,7 @@ namespace RTC case SCTP_SEND_FAILED_EVENT: { static const size_t BufferSize{ 1024 }; - static char buffer[BufferSize]; + thread_local static char buffer[BufferSize]; uint32_t len = notification->sn_send_failed_event.ssfe_length - sizeof(struct sctp_send_failed_event); @@ -1004,4 +1004,4 @@ namespace RTC } // namespace RTC -#endif //ENABLE_SCTP \ No newline at end of file +#endif //ENABLE_SCTP