Skip to content

Commit f9bc4e4

Browse files
committed
do not process binding before token is acquired
1 parent ea77732 commit f9bc4e4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

includes/ziti/model_collections.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ for(model_list_iter it = model_list_iterator(&(m)); (it) != NULL; \
132132
#define MODEL_LIST_FOREACH(el, list) \
133133
model_list_iter line_var(it); \
134134
for(line_var(it) = model_list_iterator((model_list*)&(list)); \
135-
line_var(it) != NULL && ((el) = model_list_it_element(line_var(it)), true); \
135+
line_var(it) != NULL && ((el) = (z_typeof(el))model_list_it_element(line_var(it)), true); \
136136
line_var(it) = model_list_it_next(line_var(it)))
137137

138138
#ifdef __cplusplus

library/bind.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#define REBIND_DELAY 1000
2929
#define REFRESH_DELAY (60 * 5 * 1000)
3030

31-
#define CONN_LOG(lvl, fmt, ...) ZITI_LOG(lvl, "server[%u.%u] " fmt, conn->ziti_ctx->id, conn->conn_id, ##__VA_ARGS__)
31+
#define CONN_LOG(lvl, fmt, ...) \
32+
ZITI_LOG(lvl, "server[%u.%u](%s) " fmt, \
33+
conn->ziti_ctx->id, conn->conn_id, conn->service, ##__VA_ARGS__)
3234

3335
struct binding_s {
3436
struct ziti_conn *conn;
@@ -113,6 +115,9 @@ static struct binding_s* new_binding(struct ziti_conn *conn) {
113115
}
114116

115117
void process_bindings(struct ziti_conn *conn) {
118+
if (conn->server.token == NULL) {
119+
return;
120+
}
116121

117122
struct ziti_ctx *ztx = conn->ziti_ctx;
118123

library/connect.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ static const int MAX_CONNECT_RETRY = 3;
2626
#define CONN_CAP_MASK (EDGE_MULTIPART | EDGE_TRACE_UUID | EDGE_STREAM)
2727
#define BOOL_STR(v) ((v) ? "Y" : "N")
2828

29-
#define CONN_LOG(lvl, fmt, ...) ZITI_LOG(lvl, "conn[%u.%u/%.*s/%s] " fmt, \
30-
conn->ziti_ctx->id, conn->conn_id, (int)sizeof(conn->marker), conn->marker, conn_state_str[conn->state], ##__VA_ARGS__)
29+
#define CONN_LOG(lvl, fmt, ...) ZITI_LOG(lvl, "conn[%u.%u/%.*s/%s](%s) " fmt, \
30+
conn->ziti_ctx->id, conn->conn_id, (int)sizeof(conn->marker), \
31+
conn->marker, conn_state_str[conn->state], conn->service, \
32+
##__VA_ARGS__)
3133

3234

3335
#define DEFAULT_DIAL_OPTS (ziti_dial_opts){ \

0 commit comments

Comments
 (0)