Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chardev: report the handshake error
This can help to debug connection issues.

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=2196182

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230510072531.3937189-1-marcandre.lureau@redhat.com>
  • Loading branch information
elmarco committed Aug 7, 2023
1 parent 9400601 commit 81cd34a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chardev/char-socket.c
Expand Up @@ -742,8 +742,12 @@ static void tcp_chr_websock_handshake(QIOTask *task, gpointer user_data)
{
Chardev *chr = user_data;
SocketChardev *s = user_data;
Error *err = NULL;

if (qio_task_propagate_error(task, NULL)) {
if (qio_task_propagate_error(task, &err)) {
error_reportf_err(err,
"websock handshake of character device %s failed: ",
chr->label);
tcp_chr_disconnect(chr);
} else {
if (s->do_telnetopt) {
Expand Down Expand Up @@ -778,8 +782,12 @@ static void tcp_chr_tls_handshake(QIOTask *task,
{
Chardev *chr = user_data;
SocketChardev *s = user_data;
Error *err = NULL;

if (qio_task_propagate_error(task, NULL)) {
if (qio_task_propagate_error(task, &err)) {
error_reportf_err(err,
"TLS handshake of character device %s failed: ",
chr->label);
tcp_chr_disconnect(chr);
} else {
if (s->is_websock) {
Expand Down

0 comments on commit 81cd34a

Please sign in to comment.