Skip to content

Commit 6057d76

Browse files
authored
Merge pull request #858 from openziti/fix-pending-req
make sure request is added to queue before write
2 parents 515e44e + 0c9e925 commit 6057d76

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

library/connect.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,15 +1277,10 @@ int ziti_accept(ziti_connection conn, ziti_conn_cb cb, ziti_data_cb data_cb) {
12771277
ar->cb = accept_cb;
12781278
ar->ctx = cb;
12791279

1280+
TAILQ_INSERT_TAIL(&conn->pending_wreqs, ar, _next);
12801281
int rc = ziti_channel_send(ch, content_type, headers, 3,
12811282
(const uint8_t *) &clt_conn_id, sizeof(clt_conn_id),
12821283
ar);
1283-
if (rc == ZITI_OK) {
1284-
TAILQ_INSERT_TAIL(&conn->pending_wreqs, ar, _next);
1285-
} else {
1286-
free(ar);
1287-
}
1288-
12891284
return rc;
12901285
}
12911286

0 commit comments

Comments
 (0)