Skip to content

Commit

Permalink
fixup: clang-format, redundant flag clear
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti committed Jun 30, 2023
1 parent 89e88b8 commit 216f557
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/adaptors/tcp/tcp_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ struct qdr_tcp_connection_t {
bool flow_enabled;
bool is_egress_dispatcher_conn;
bool connector_closed;//only used if egress_dispatcher=true
bool in_list; // This connection is in the adaptor's connections list
bool in_list; // This connection is in the adaptor's connections list
bool raw_read_shutdown; // stream closed
bool read_eos_seen;
bool window_disabled; // true: ignore unacked byte window
bool require_tls; // Is TLS required on this connection ?
sys_atomic_t check_idle_conn; // check if connection has been idle
sys_atomic_t raw_closed_read; // proton event seen
sys_atomic_t raw_closed_write; // proton event seen or write_close called
bool require_tls; // Is TLS required on this connection ?
sys_atomic_t check_idle_conn; // check if connection has been idle
sys_atomic_t raw_closed_read; // proton event seen
sys_atomic_t raw_closed_write; // proton event seen or write_close called
qdr_delivery_t *initial_delivery;
qd_timer_t *activate_timer;
qd_timer_t *idle_timer;
qd_timer_t *idle_timer;
qd_tcp_adaptor_config_t *config; // config
qd_server_t *server;
qd_tls_t *tls;
Expand Down Expand Up @@ -249,7 +249,7 @@ static void on_activate(void *context)
//
static void on_idle_timer(void *context)
{
qdr_tcp_connection_t* conn = (qdr_tcp_connection_t*) context;
qdr_tcp_connection_t *conn = (qdr_tcp_connection_t *) context;
SET_ATOMIC_FLAG(&conn->check_idle_conn);
pn_raw_connection_wake(conn->pn_raw_conn);
}
Expand Down Expand Up @@ -1116,13 +1116,11 @@ static void handle_connection_event(pn_event_t *e, qd_server_t *qd_server, void
qd_log(LOG_TCP_ADAPTOR, QD_LOG_DEBUG, "[C%" PRIu64 "] PN_RAW_CONNECTION_WAKE %s", conn->conn_id,
qdr_tcp_connection_role_name(conn));
if (CLEAR_ATOMIC_FLAG(&conn->check_idle_conn)) {
conn->check_idle_conn = false;
uint64_t new_snapshot = conn->bytes_in + conn->bytes_out;
if (new_snapshot == conn->idle_snapshot) {
// TODO(kgiusti): need vflow update!
qd_log(LOG_TCP_ADAPTOR, QD_LOG_WARNING,
"[C%" PRIu64 "] idle TCP client detected, closing the connection",
conn->conn_id);
"[C%" PRIu64 "] idle TCP client detected, closing the connection", conn->conn_id);
pn_raw_connection_close(conn->pn_raw_conn); // thread-safe call
break;
} else {
Expand Down

0 comments on commit 216f557

Please sign in to comment.