wangzhengquan
2020-10-16 350b7fe82c54117f423fc1bc174f6f65ba855fc4
update
1个文件已删除
1个文件已修改
9 ■■■■ 已修改文件
src/libshm_queue.a 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_socket.c 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/libshm_queue.a
Binary files differ
src/socket/net_mod_socket.c
@@ -1,6 +1,8 @@
#include "net_mod_socket.h"
#include "socket_io.h"
#include "net_mod_socket_io.h"
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
std::map<std::string, int> NetModSocket::connectionMap;
@@ -57,7 +59,7 @@
  char response_head_bs[NET_MODE_RESPONSE_HEAD_LENGTH];
  net_mod_request_head_t request_head = {};
  net_mod_response_head_t response_head;
  int optval;
   
  int nsuc = 0;
  net_mod_recv_msg_t *ret_arr = (net_mod_recv_msg_t *)calloc(arrlen, sizeof(net_mod_recv_msg_t));
@@ -79,6 +81,8 @@
    request_head.key = node->key;
    request_head.content_length = send_size;
    request_head.topic_length = 0;
    // optval = 1;
    // setsockopt(clientfd, IPPROTO_TCP, TCP_CORK, &optval, sizeof(optval));
    if(rio_writen(clientfd, NetModSocket::encode_request_head(request_head), NET_MODE_REQUEST_HEAD_LENGTH) != NET_MODE_REQUEST_HEAD_LENGTH) {
      LoggerFactory::getLogger()->error(errno, "NetModSocket::send head rio_writen");
      remove_connect(node->host, node->port);
@@ -93,7 +97,8 @@
      close(clientfd);
      continue;
    }
    // optval = 0;
    // setsockopt(clientfd, IPPROTO_TCP, TCP_CORK, &optval, sizeof(optval));
    if ( rio_readn(clientfd, response_head_bs, NET_MODE_RESPONSE_HEAD_LENGTH) !=  NET_MODE_RESPONSE_HEAD_LENGTH) {
      LoggerFactory::getLogger()->error(errno, "NetModSocket::send  rio_readnb");