From a60423c68d7811b5fe133c7cf6373cacd7b50d9d Mon Sep 17 00:00:00 2001 From: Street Pea Date: Thu, 31 Oct 2024 15:59:31 -0700 Subject: [PATCH] Update holepunch test for changes to offer being stored in holepunch session --- lib/src/remote/holepunch-test.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/src/remote/holepunch-test.c b/lib/src/remote/holepunch-test.c index a2e47718c..6840c79c9 100644 --- a/lib/src/remote/holepunch-test.c +++ b/lib/src/remote/holepunch-test.c @@ -134,9 +134,7 @@ int main(int argc, char **argv) } printf(">> Created session\n"); - ChiakiHolepunchMessage our_offer_msg_ctrl = NULL; - ChiakiHolepunchCandidate local_candidates = NULL; - err = holepunch_session_create_offer(session, &local_candidates, &our_offer_msg_ctrl); + err = holepunch_session_create_offer(session); if (err != CHIAKI_ERR_SUCCESS) { fprintf(stderr, "!! Failed to create offer msg for ctrl connection"); @@ -147,47 +145,34 @@ int main(int argc, char **argv) if (err != CHIAKI_ERR_SUCCESS) { fprintf(stderr, "!! Failed to start session\n"); - if(local_candidates) - free(local_candidates); chiaki_holepunch_session_fini(session); return -1; } printf(">> Started session\n"); - err = chiaki_holepunch_session_punch_hole(session, local_candidates, our_offer_msg_ctrl, CHIAKI_HOLEPUNCH_PORT_TYPE_CTRL); + err = chiaki_holepunch_session_punch_hole(session, CHIAKI_HOLEPUNCH_PORT_TYPE_CTRL); if (err != CHIAKI_ERR_SUCCESS) { fprintf(stderr, "!! Failed to punch hole for control connection.\n"); - if(local_candidates) - free(local_candidates); chiaki_holepunch_session_fini(session); return -1; } printf(">> Punched hole for control connection!\n"); - if(local_candidates) - free(local_candidates); - local_candidates = NULL; - - ChiakiHolepunchMessage our_offer_msg_data = NULL; - err = holepunch_session_create_offer(session, &local_candidates, &our_offer_msg_data); + err = holepunch_session_create_offer(session); if (err != CHIAKI_ERR_SUCCESS) { fprintf(stderr, "!! Failed to create offer msg for ctrl connection"); return err; } printf(">> Created offer msg for ctrl connection\n"); - err = chiaki_holepunch_session_punch_hole(session, local_candidates, our_offer_msg_data, CHIAKI_HOLEPUNCH_PORT_TYPE_DATA); + err = chiaki_holepunch_session_punch_hole(session, CHIAKI_HOLEPUNCH_PORT_TYPE_DATA); if (err != CHIAKI_ERR_SUCCESS) { fprintf(stderr, "!! Failed to punch hole for data connection.\n"); - if(local_candidates) - free(local_candidates); chiaki_holepunch_session_fini(session); return -1; } printf(">> Punched hole for data connection!\n"); - if(local_candidates) - free(local_candidates); printf(">> Successfully punched holes for all neccessary connections!\n");