From 82b028cf63953d8080b63d85468eae488d212194 Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@smartai.com>
Date: 星期四, 23 九月 2021 14:30:07 +0800
Subject: [PATCH] Fix the data parsing when in multiple threads.

---
 src/socket/shm_socket.cpp |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/src/socket/shm_socket.cpp b/src/socket/shm_socket.cpp
index 6705b96..1912772 100644
--- a/src/socket/shm_socket.cpp
+++ b/src/socket/shm_socket.cpp
@@ -166,20 +166,8 @@
   return 0;
 }
 
-int shm_socket_bind_proc_id(shm_socket_t *sockt, const char *buf, int len) {
-  strncpy(sockt->proc_id, buf, len > MAX_STR_LEN ? MAX_STR_LEN : len);
-
-  return 0;
-}
-
 int shm_socket_get_key(shm_socket_t *sockt){
   return sockt->key;
-}
-
-int shm_socket_get_procid(shm_socket_t *sockt, char *buf, int len) {
-  strncpy(buf, sockt->proc_id, len);
-
-  return 0;
 }
 
 // 鐭繛鎺ユ柟寮忓彂閫�
@@ -462,9 +450,8 @@
     tryn--;
     recvbufIter = tmp_socket->recvbuf2.find(key);
     if(recvbufIter != tmp_socket->recvbuf2.end()) {
-      // 鍦ㄧ紦瀛橀噷鏌ュ埌浜唊ey鍖归厤鎴愬姛鐨�
       recvpak = recvbufIter->second;
-      tmp_socket->recvbuf2.erase(recvbufIter);
+      tmp_socket->recvbuf2.erase(key);
       goto LABLE_SUC;
     }
 
@@ -481,7 +468,6 @@
     } else {
       // 绛旈潪鎵�闂紝鏀惧埌缂撳瓨閲�
       tmp_socket->recvbuf2.insert({recvpak.key, recvpak});
-      exit(0);
       continue;
     }
   }

--
Gitblit v1.8.0