From 5ac41d01f72ceb87eb7b5e14ef6c9d3d9232a75b Mon Sep 17 00:00:00 2001 From: obdev Date: Sat, 22 Apr 2023 14:41:23 +0000 Subject: [PATCH] obd: support deploy.py syntax --- deps/easy/src/io/easy_negotiation.c | 18 +++++++++--------- tools/deploy/activate_obd.sh | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/deps/easy/src/io/easy_negotiation.c b/deps/easy/src/io/easy_negotiation.c index a0622d2f2..b6c51089c 100644 --- a/deps/easy/src/io/easy_negotiation.c +++ b/deps/easy/src/io/easy_negotiation.c @@ -13,9 +13,9 @@ #include "io/easy_negotiation.h" #include "io/easy_log.h" #include "io/easy_socket.h" -#include -#include - +#include +#include + const uint64_t g_support_eio_maigc[] = { 0x12567348667799aa, 0x1237734866785431, @@ -215,9 +215,9 @@ int net_send_negotiate_message(uint8_t negotiation_enable, int fd, uint64_t magi if ((ret = easy_socket_error(fd) ) != 0) { easy_info_log("retry! socket status is abnormal yet, fd:%d, addr:%s, err:%d.", fd, addr_str, ret); if (conn_has_error) *conn_has_error = 1; - return ret; - } - + return ret; + } + while ((send_bytes = send(fd, buf, encode_len, 0)) < 0 && errno == EINTR); if (send_bytes != encode_len) { @@ -225,9 +225,9 @@ int net_send_negotiate_message(uint8_t negotiation_enable, int fd, uint64_t magi return -1; } else { easy_info_log("eio:%#llx, thread index:%hhu, send:%d bytes, send negotiation success. addr:%s!", (unsigned long long)ne_msg.msg_body.eio_magic, - ne_msg.msg_body.io_thread_index, encode_len, addr_str); - } - } + ne_msg.msg_body.io_thread_index, encode_len, addr_str); + } + } } else { easy_info_log("negotiation not enabled!(addr:%s)", addr_str); } diff --git a/tools/deploy/activate_obd.sh b/tools/deploy/activate_obd.sh index d9ac2a5cc..b82c388eb 100644 --- a/tools/deploy/activate_obd.sh +++ b/tools/deploy/activate_obd.sh @@ -3,14 +3,15 @@ DIR=$(readlink -f "$(dirname ${BASH_SOURCE[0]})/../..") export DEPLOY_PATH=$DIR/tools/deploy if grep 'dep_create.sh' $DIR/build.sh 2>&1 >/dev/null then - DEP_PATH=$DIR/deps/3rd + export DEP_PATH=$DIR/deps/3rd else - DEP_PATH=$DIR/rpm/.dep_create/var + export DEP_PATH=$DIR/rpm/.dep_create/var fi export OBD_BIN=${_OBD_BIN:-$DEP_PATH/usr/bin/obd} alias obd="${OBD_BIN}" export OBD_HOME=${_OBD_HOME:-$DIR/tools/deploy} export OBD_INSTALL_PRE=${_OBD_INSTALL_PRE:-$DEP_PATH} +export OBD_PORT_GEN=$((100*($(id -u)%500)+10000)) if [ ${_OBD_PROFILE} ]; then source ${_OBD_PROFILE}