Skip to content

Commit

Permalink
avoid setting immediate timeout on connect (#606)
Browse files Browse the repository at this point in the history
* avoid setting immediate timeout on connect

* init header value
  • Loading branch information
ekoby authored Jan 4, 2024
1 parent ad42129 commit 2e9e833
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static void hello_reply_cb(void *ctx, message *msg, int err) {
}

static void send_hello(ziti_channel_t *ch, ziti_api_session *session) {
uint8_t true_val;
uint8_t true_val = 1;
hdr_t headers[] = {
{
.header_id = SessionTokenHeader,
Expand Down
11 changes: 6 additions & 5 deletions library/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,12 @@ static void process_connect(struct ziti_conn *conn) {
conn);
return;
} else {
req->conn_timeout = calloc(1, sizeof(uv_timer_t));
uv_timer_init(loop, req->conn_timeout);
req->conn_timeout->data = conn;
uv_timer_start(req->conn_timeout, connect_timeout, req->dial_opts.connect_timeout_seconds * 1000, 0);

if (req->dial_opts.connect_timeout_seconds > 0) {
req->conn_timeout = calloc(1, sizeof(uv_timer_t));
uv_timer_init(loop, req->conn_timeout);
req->conn_timeout->data = conn;
uv_timer_start(req->conn_timeout, connect_timeout, req->dial_opts.connect_timeout_seconds * 1000, 0);
}
CONN_LOG(DEBUG, "starting %s connection for service[%s] with session[%s]",
ziti_session_types.name(req->session_type), conn->service, req->session->id);
ziti_connect(ztx, req->session, conn);
Expand Down

0 comments on commit 2e9e833

Please sign in to comment.