🐞 fix(fix monit server compile error): call gettimeofday directly
This commit is contained in:
@@ -18,7 +18,7 @@ struct stm_connection_manager *stm_connection_insert(struct evhttp_connection *e
|
||||
{
|
||||
if (ele->conn == evconn)
|
||||
{
|
||||
stm->gettime_cb(&ele->last_active_time, NULL);
|
||||
gettimeofday(&ele->last_active_time, NULL);
|
||||
return ele;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ struct stm_connection_manager *stm_connection_insert(struct evhttp_connection *e
|
||||
strncpy(new_conn->peer_ipaddr, tmp_ip_addr, INET6_ADDRSTRLEN - 1);
|
||||
}
|
||||
new_conn->peer_port_host_order = tmp_port;
|
||||
stm->gettime_cb(&new_conn->link_start_time, NULL);
|
||||
gettimeofday(&new_conn->link_start_time, NULL);
|
||||
new_conn->last_active_time = new_conn->link_start_time;
|
||||
new_conn->conn = evconn;
|
||||
DL_APPEND(stm->connection_mgr, new_conn);
|
||||
@@ -58,13 +58,12 @@ void stm_connection_delete(struct evhttp_connection *evconn)
|
||||
|
||||
void stm_connection_update(struct stm_connection_manager *conn_mgr, const struct evhttp_connection *evconn)
|
||||
{
|
||||
struct stellar_monitor *stm = stellar_monitor_get();
|
||||
struct stm_connection_manager *ele, *tmp;
|
||||
DL_FOREACH_SAFE(conn_mgr, ele, tmp)
|
||||
{
|
||||
if (ele->conn == evconn)
|
||||
{
|
||||
stm->gettime_cb(&ele->last_active_time, NULL);
|
||||
gettimeofday(&ele->last_active_time, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user