From 1565b78fcdd511b1e353851a609d5e4251f513c5 Mon Sep 17 00:00:00 2001 From: jmjatlanta Date: Thu, 12 Oct 2017 08:37:19 -0500 Subject: [PATCH] more adjustments for yamux testing --- test/test_secio.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/test_secio.h b/test/test_secio.h index 19b65a5..2b7cb4b 100644 --- a/test/test_secio.h +++ b/test/test_secio.h @@ -150,7 +150,22 @@ int test_secio_handshake() { goto exit; } - fprintf(stdout, "Results of ls: %.*s", (int)results_size, results); + fprintf(stdout, "Results of ls (%d bytes long):\n%s\n", (int)results_size, results); + + free(results); + results = NULL; + // try to yamux + char* yamux_string = "/yamux/1.0.0\n"; + if (!libp2p_net_multistream_write(secure_session, (uint8_t*)yamux_string, strlen(yamux_string))) { + libp2p_logger_error("test_secio", "Unable to send yamux protocol request\n"); + goto exit; + } + if (!libp2p_net_multistream_read(secure_session, &results, &results_size, 30)) { + libp2p_logger_error("test_secio", "Unable to read reply to yamux request.\n"); + goto exit; + } + + fprintf(stdout, "Results of yamux request: %s\n", results); free(results); results = NULL;