fujuntang
2021-12-07 22cd4140502e67d32967160bee56375eaa285011
src/bh_api.cpp
@@ -1244,7 +1244,8 @@
  char data_buf[MAX_STR_LEN] = { 0x00 };
  char buf_temp[MAX_STR_LEN] = { 0x00 };
  char *topics_buf = NULL;
  hashtable_t *hashtable = mm_get_hashtable();
#if defined(PRO_DE_SERIALIZE)
  struct _BHAddress
   {
@@ -1301,14 +1302,19 @@
#else 
  strncpy(buf_temp, (char *)request, (sizeof(buf_temp) - 1) > strlen((char *)request) ? strlen((char *)request) : (sizeof(buf_temp) - 1));
#endif 
  str = buf_temp;
  val = net_mod_socket_buf_data_get(gNetmod_socket, str);
  if(val > 0) {
  if ((val > 0) && (hashtable_get(hashtable, val) != NULL)) {
    rv = 0;
  } else {
    if ((val > 0) && (hashtable_get(hashtable, val) == NULL)) {
      net_mod_socket_buf_data_del(gNetmod_socket, str);
    }
    rv = net_mod_socket_reg(gNetmod_socket, buf_temp, strlen(buf_temp), &buf, &size, timeout_ms, PROC_QUE_STCS);
    if (rv == 0) {
@@ -1420,7 +1426,8 @@
  char *errString = NULL;
  char buf_temp[MAX_STR_LEN] = { 0x00 };
  char *topics_buf = NULL;
  hashtable_t *hashtable = mm_get_hashtable();
  struct _RequestReply
  {
    std::string proc_id;
@@ -1487,10 +1494,13 @@
 
  str = buf_temp;
  val = net_mod_socket_buf_data_get(gNetmod_socket, str);
  if(val > 0) {
  if ((val > 0) && (hashtable_get(hashtable, val) != NULL)) {
    rv = 0;
  } else {
    if ((val > 0) && (hashtable_get(hashtable, val) == NULL)) {
      net_mod_socket_buf_data_del(gNetmod_socket, str);
    }
    rv = net_mod_socket_reg(gNetmod_socket, buf_temp, strlen(buf_temp), &buf, &size, timeout_ms, PROC_QUE_STCS);
    if (rv == 0) {