obd: support deploy.py syntax

This commit is contained in:
obdev
2023-04-22 14:41:23 +00:00
committed by ob-robot
parent 7edaa0071b
commit 5ac41d01f7
2 changed files with 12 additions and 11 deletions

View File

@ -13,9 +13,9 @@
#include "io/easy_negotiation.h" #include "io/easy_negotiation.h"
#include "io/easy_log.h" #include "io/easy_log.h"
#include "io/easy_socket.h" #include "io/easy_socket.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
const uint64_t g_support_eio_maigc[] = { const uint64_t g_support_eio_maigc[] = {
0x12567348667799aa, 0x12567348667799aa,
0x1237734866785431, 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) { 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); 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; if (conn_has_error) *conn_has_error = 1;
return ret; return ret;
} }
while ((send_bytes = send(fd, buf, encode_len, 0)) < 0 && errno == EINTR); while ((send_bytes = send(fd, buf, encode_len, 0)) < 0 && errno == EINTR);
if (send_bytes != encode_len) { 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; return -1;
} else { } 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, 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 { } else {
easy_info_log("negotiation not enabled!(addr:%s)", addr_str); easy_info_log("negotiation not enabled!(addr:%s)", addr_str);
} }

View File

@ -3,14 +3,15 @@ DIR=$(readlink -f "$(dirname ${BASH_SOURCE[0]})/../..")
export DEPLOY_PATH=$DIR/tools/deploy export DEPLOY_PATH=$DIR/tools/deploy
if grep 'dep_create.sh' $DIR/build.sh 2>&1 >/dev/null if grep 'dep_create.sh' $DIR/build.sh 2>&1 >/dev/null
then then
DEP_PATH=$DIR/deps/3rd export DEP_PATH=$DIR/deps/3rd
else else
DEP_PATH=$DIR/rpm/.dep_create/var export DEP_PATH=$DIR/rpm/.dep_create/var
fi fi
export OBD_BIN=${_OBD_BIN:-$DEP_PATH/usr/bin/obd} export OBD_BIN=${_OBD_BIN:-$DEP_PATH/usr/bin/obd}
alias obd="${OBD_BIN}" alias obd="${OBD_BIN}"
export OBD_HOME=${_OBD_HOME:-$DIR/tools/deploy} export OBD_HOME=${_OBD_HOME:-$DIR/tools/deploy}
export OBD_INSTALL_PRE=${_OBD_INSTALL_PRE:-$DEP_PATH} export OBD_INSTALL_PRE=${_OBD_INSTALL_PRE:-$DEP_PATH}
export OBD_PORT_GEN=$((100*($(id -u)%500)+10000))
if [ ${_OBD_PROFILE} ]; then if [ ${_OBD_PROFILE} ]; then
source ${_OBD_PROFILE} source ${_OBD_PROFILE}