Skip to content

Commit

Permalink
call conn_pool_connect_server with timeout_ms
Browse files Browse the repository at this point in the history
  • Loading branch information
happyfish100 committed Oct 24, 2023
1 parent 64e0a53 commit 8363843
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion php_client/fastdfs_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ static void php_fdfs_connect_server_impl(INTERNAL_FUNCTION_PARAMETERS, \
server_info.sock = -1;

if ((pContext->err_no=conn_pool_connect_server(&server_info, \
SF_G_NETWORK_TIMEOUT)) == 0)
SF_G_NETWORK_TIMEOUT * 1000)) == 0)
{
array_init(return_value);
zend_add_assoc_stringl_ex(return_value, "ip_addr", \
Expand Down
2 changes: 1 addition & 1 deletion storage/fdfs_storaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static void sigAlarmHandler(int sig)
server.port = SF_G_INNER_PORT;
server.sock = -1;

if (conn_pool_connect_server(&server, SF_G_CONNECT_TIMEOUT) != 0)
if (conn_pool_connect_server(&server, SF_G_CONNECT_TIMEOUT * 1000) != 0)
{
return;
}
Expand Down
8 changes: 4 additions & 4 deletions test/dfs_func_pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static ConnectionInfo *getConnectedStorageServer(
{
if (pServer->sock < 0)
{
*err_no = conn_pool_connect_server(pServer, \
SF_G_CONNECT_TIMEOUT);
*err_no = conn_pool_connect_server(pServer,
SF_G_CONNECT_TIMEOUT * 1000);
if (*err_no != 0)
{
return NULL;
Expand All @@ -46,8 +46,8 @@ static ConnectionInfo *getConnectedStorageServer(
pServer = pEnd;
memcpy(pServer, pStorageServer, sizeof(ConnectionInfo));
pServer->sock = -1;
if ((*err_no=conn_pool_connect_server(pServer, \
SF_G_CONNECT_TIMEOUT)) != 0)
if ((*err_no=conn_pool_connect_server(pServer,
SF_G_CONNECT_TIMEOUT * 1000)) != 0)
{
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion tracker/fdfs_trackerd.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ static void sigAlarmHandler(int sig)
server.port = SF_G_INNER_PORT;
server.sock = -1;

if (conn_pool_connect_server(&server, SF_G_CONNECT_TIMEOUT) != 0)
if (conn_pool_connect_server(&server, SF_G_CONNECT_TIMEOUT * 1000) != 0)
{
return;
}
Expand Down
6 changes: 3 additions & 3 deletions tracker/tracker_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ ConnectionInfo *tracker_connect_server_no_pool_ex(TrackerServerInfo *pServerInfo
}

*err_no = conn_pool_connect_server_ex(pServerInfo->connections
+ pServerInfo->index, SF_G_CONNECT_TIMEOUT,
+ pServerInfo->index, SF_G_CONNECT_TIMEOUT * 1000,
bind_addr, log_connect_error);
if (*err_no == 0)
{
Expand All @@ -520,7 +520,7 @@ ConnectionInfo *tracker_connect_server_no_pool_ex(TrackerServerInfo *pServerInfo
if (current_index != pServerInfo->index)
{
if ((*err_no=conn_pool_connect_server_ex(conn,
SF_G_CONNECT_TIMEOUT, bind_addr,
SF_G_CONNECT_TIMEOUT * 1000, bind_addr,
log_connect_error)) == 0)
{
pServerInfo->index = current_index;
Expand All @@ -542,7 +542,7 @@ ConnectionInfo *tracker_make_connection_ex(ConnectionInfo *conn,
}
else
{
*err_no = conn_pool_connect_server(conn, connect_timeout);
*err_no = conn_pool_connect_server(conn, connect_timeout * 1000);
if (*err_no != 0)
{
return NULL;
Expand Down

0 comments on commit 8363843

Please sign in to comment.