From aa2f3b2a9968bb4928463bdae05fb026d16b60bb Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期五, 04 十二月 2020 19:07:01 +0800
Subject: [PATCH] 固定bus key

---
 src/socket/net_mod_server_socket.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/socket/net_mod_server_socket.c b/src/socket/net_mod_server_socket.c
index a021aa8..8959231 100644
--- a/src/socket/net_mod_server_socket.c
+++ b/src/socket/net_mod_server_socket.c
@@ -3,6 +3,7 @@
 #include "socket_io.h"
 #include "net_mod_socket_io.h"
 #include "net_mod_socket.h"
+#include "key_def.h"
  
 static  Logger * logger = LoggerFactory::getLogger();
 
@@ -139,8 +140,8 @@
 
   request_head = NetModSocket::decode_request_head(request_head_bs);
   
-printf("server received request from host = %s:%d, key = %d, timeout=%d,\n", 
-  request_head.host, request_head.port , request_head.key, request_head.timeout);
+// printf("server received request from host = %s:%d, key = %d, timeout=%d,\n", 
+//   request_head.host, request_head.port , request_head.key, request_head.timeout);
 
   if(request_head.content_length > max_buf) {
    
@@ -226,21 +227,21 @@
     if (rio_readn(connfd, topic_buf, request_head.topic_length) != request_head.topic_length ) {
       return -1;
     }
-LoggerFactory::getLogger()->debug("====server pub %s===\n", buf);
+// LoggerFactory::getLogger()->debug("====server pub %s===\n", buf);
     memcpy(response_head.host, request_head.host, NI_MAXHOST);
     response_head.port = request_head.port;
-    response_head.key = request_head.key;
+    // response_head.key = request_head.key;
 
     if(request_head.timeout > 0) {
       timeout.tv_sec = request_head.timeout / 1000;
       timeout.tv_nsec = (request_head.timeout - timeout.tv_sec * 1000) * 10e6;
-      ret = shmModSocket.pub_timeout((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, request_head.key, &timeout);
+      ret = shmModSocket.pub_timeout((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY, &timeout);
     }
     else if(request_head.timeout == 0) {
-      ret = shmModSocket.pub_nowait((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, request_head.key);
+      ret = shmModSocket.pub_nowait((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY);
     }
     else if(request_head.timeout == -1) {
-      ret = shmModSocket.pub((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, request_head.key);
+      ret = shmModSocket.pub((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY);
     }
    
     response_head.code = ret;

--
Gitblit v1.8.0