[TD-13760]<fix>: libuv replace socket error.
This commit is contained in:
parent
3588761cc7
commit
44367a009f
|
@ -34,16 +34,10 @@
|
|||
#include <sys/epoll.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_UV
|
||||
#include <uv.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef USE_UV
|
||||
|
||||
#define TAOS_EPOLL_WAIT_TIME 500
|
||||
typedef int32_t SOCKET;
|
||||
typedef SOCKET EpollFd;
|
||||
|
@ -92,8 +86,6 @@ SOCKET taosOpenTcpClientSocket(uint32_t ip, uint16_t port, uint32_t localIp);
|
|||
SOCKET taosOpenTcpServerSocket(uint32_t ip, uint16_t port);
|
||||
int32_t taosKeepTcpAlive(SOCKET sockFd);
|
||||
|
||||
#endif
|
||||
|
||||
void taosBlockSIGPIPE();
|
||||
uint32_t taosGetIpv4FromFqdn(const char *);
|
||||
int32_t taosGetFqdn(char *);
|
||||
|
|
|
@ -17,7 +17,7 @@ TARGET_INCLUDE_DIRECTORIES(
|
|||
PRIVATE "${CMAKE_SOURCE_DIR}/source/libs/catalog/inc"
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME catalogTest
|
||||
COMMAND catalogTest
|
||||
)
|
||||
# add_test(
|
||||
# NAME catalogTest
|
||||
# COMMAND catalogTest
|
||||
# )
|
||||
|
|
|
@ -3,10 +3,11 @@ add_library(monitor STATIC ${MONITOR_SRC})
|
|||
target_include_directories(
|
||||
monitor
|
||||
PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/monitor"
|
||||
PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/transport"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
||||
target_link_libraries(monitor os util common)
|
||||
target_link_libraries(monitor os util common transport)
|
||||
|
||||
if(${BUILD_TEST})
|
||||
add_subdirectory(test)
|
||||
|
|
|
@ -111,18 +111,16 @@ _OVER:
|
|||
}
|
||||
|
||||
#ifdef USE_UV
|
||||
#include <uv.h>
|
||||
static void clientConnCb(uv_connect_t* req, int32_t status) {
|
||||
if (status < 0) {
|
||||
terrno = TAOS_SYSTEM_ERROR(status);
|
||||
uError("Connection error %s\n", uv_strerror(status));
|
||||
uv_close((uv_handle_t*)req->handle, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// impl later
|
||||
uv_buf_t* wb = req->data;
|
||||
if (wb == NULL) {
|
||||
uv_close((uv_handle_t*)req->handle, NULL);
|
||||
}
|
||||
assert(wb != NULL);
|
||||
uv_write_t write_req;
|
||||
uv_write(&write_req, req->handle, wb, 2, NULL);
|
||||
uv_close((uv_handle_t*)req->handle, NULL);
|
|
@ -34,8 +34,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_UV
|
||||
|
||||
// typedef struct TdSocketServer {
|
||||
// #if SOCKET_WITH_LOCK
|
||||
// pthread_rwlock_t rwlock;
|
||||
|
@ -686,10 +684,6 @@ int64_t taosCopyFds(SOCKET sfd, int32_t dfd, int64_t len) {
|
|||
return len;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void taosBlockSIGPIPE() {
|
||||
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
|
||||
#else
|
||||
|
|
|
@ -12,13 +12,6 @@ target_link_libraries(
|
|||
PUBLIC lz4_static
|
||||
PUBLIC api cjson zlib
|
||||
)
|
||||
if(${BUILD_WITH_UV})
|
||||
target_link_libraries(
|
||||
util
|
||||
PUBLIC uv_a
|
||||
)
|
||||
add_definitions(-DUSE_UV)
|
||||
endif(${BUILD_TEST})
|
||||
|
||||
if(${BUILD_TEST})
|
||||
ADD_SUBDIRECTORY(test)
|
||||
|
|
Loading…
Reference in New Issue