提交 687326ce 编写于 作者: H Hugo Landau 提交者: Matt Caswell

QUIC MULTISTREAM TEST: Output connection closure reason info on failure

Reviewed-by: NPaul Dale <pauli@openssl.org>
Reviewed-by: NTomas Mraz <tomas@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22485)
上级 55abe748
......@@ -1945,6 +1945,8 @@ out:
s_unlock(h, hl); /* idempotent */
if (!testresult) {
size_t i;
const QUIC_TERMINATE_CAUSE *tcause;
const char *e_str, *f_str;
TEST_error("failed in script \"%s\" at op %zu, thread %d\n",
script_name, op_idx + 1, thread_idx);
......@@ -1954,6 +1956,56 @@ out:
repeat_stack_done[i],
repeat_stack_limit[i],
repeat_stack_idx[i]);
ERR_print_errors_fp(stderr);
if (h->c_conn != NULL) {
SSL_CONN_CLOSE_INFO cc_info = {0};
if (SSL_get_conn_close_info(h->c_conn, &cc_info, sizeof(cc_info))) {
e_str = ossl_quic_err_to_string(cc_info.error_code);
f_str = ossl_quic_frame_type_to_string(cc_info.frame_type);
if (e_str == NULL)
e_str = "?";
if (f_str == NULL)
f_str = "?";
TEST_info("client side is closed: %llu(%s)/%llu(%s), "
"%s, %s, reason: \"%s\"",
(unsigned long long)cc_info.error_code,
e_str,
(unsigned long long)cc_info.frame_type,
f_str,
(cc_info.flags & SSL_CONN_CLOSE_FLAG_LOCAL) != 0
? "local" : "remote",
(cc_info.flags & SSL_CONN_CLOSE_FLAG_TRANSPORT) != 0
? "transport" : "app",
cc_info.reason != NULL ? cc_info.reason : "-");
}
}
tcause = (h->s != NULL
? ossl_quic_tserver_get_terminate_cause(h->s) : NULL);
if (tcause != NULL) {
e_str = ossl_quic_err_to_string(tcause->error_code);
f_str = ossl_quic_frame_type_to_string(tcause->frame_type);
if (e_str == NULL)
e_str = "?";
if (f_str == NULL)
f_str = "?";
TEST_info("server side is closed: %llu(%s)/%llu(%s), "
"%s, %s, reason: \"%s\"",
(unsigned long long)tcause->error_code,
e_str,
(unsigned long long)tcause->frame_type,
f_str,
tcause->remote ? "remote" : "local",
tcause->app ? "app" : "transport",
tcause->reason != NULL ? tcause->reason : "-");
}
}
OPENSSL_free(tmp_buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册