diff --git a/tests/testlib/s2n_ktls_test_utils.c b/tests/testlib/s2n_ktls_test_utils.c index 3dc84dbc363..b38966f0ac7 100644 --- a/tests/testlib/s2n_ktls_test_utils.c +++ b/tests/testlib/s2n_ktls_test_utils.c @@ -62,6 +62,9 @@ ssize_t s2n_test_ktls_sendmsg_io_stuffer(void *io_context, const struct msghdr * size_t len = msg->msg_iov[count].iov_len; if (s2n_stuffer_write_bytes(data_buffer, buf, len) != S2N_SUCCESS) { + fprintf(stderr, "Stuffer write of %li@%li failed with %s / %s\n", + (uintptr_t) buf, len, + s2n_strerror(s2n_errno, NULL), s2n_strerror_debug(s2n_errno, NULL)); size_t partial_len = MIN(len, s2n_stuffer_space_remaining(data_buffer)); POSIX_GUARD(s2n_stuffer_write_bytes(data_buffer, buf, partial_len)); total_len += partial_len; diff --git a/tests/unit/s2n_ktls_io_test.c b/tests/unit/s2n_ktls_io_test.c index 7de62ef4e5d..89f0347ff60 100644 --- a/tests/unit/s2n_ktls_io_test.c +++ b/tests/unit/s2n_ktls_io_test.c @@ -23,6 +23,8 @@ #define S2N_TEST_TO_SEND 10 #define S2N_TEST_MSG_IOVLEN 5 +extern s2n_ktls_sendmsg_fn s2n_sendmsg_fn; + S2N_RESULT s2n_ktls_set_control_data(struct msghdr *msg, char *buf, size_t buf_size, int cmsg_type, uint8_t record_type); S2N_RESULT s2n_ktls_get_control_data(struct msghdr *msg, int cmsg_type, uint8_t *record_type); @@ -825,6 +827,17 @@ int main(int argc, char **argv) s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t result = s2n_ktls_sendv_with_offset(conn, test_iovecs.iovecs, test_iovecs.iovecs_count, offset, &blocked); + fprintf(stderr, "%li result = %li\n", offset, result); + fprintf(stderr, "%li sendmsg_fn=%li conn.io_context=%li out=%li\n", offset, + (uintptr_t) s2n_sendmsg_fn, (uintptr_t) conn->send_io_context, (uintptr_t) &out); + fprintf(stderr, "%li control.growable=%i data.growable=%i " + "data.allocated=%i data.write_cursor=%i " + "data.read_cursor=%i\n", offset, + out.ancillary_buffer.growable, + out.data_buffer.growable, + out.data_buffer.blob.allocated, + out.data_buffer.write_cursor, + out.data_buffer.read_cursor); EXPECT_EQUAL(result, expected_sent); EXPECT_EQUAL(out.sendmsg_invoked_count, 1);