diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-08-11 15:20:58 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2017-01-23 15:32:18 +0000 |
commit | 60e705c51c66373f78e536e0462744a610c27cf6 (patch) | |
tree | a92d50a052c105d1554b11ab4c89a90f15a54be0 /ui | |
parent | 1a447e4f0266d757687b38146795b95525d37d94 (diff) |
io: change the QIOTask callback signature
Currently the QIOTaskFunc signature takes an Object * for
the source, and an Error * for any error. We also need to
be able to provide a result pointer. Rather than continue
to add parameters to QIOTaskFunc, remove the existing
ones and simply pass the QIOTask object instead. This
has methods to access all the other data items required
in the callback impl.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/vnc-auth-vencrypt.c | 7 | ||||
-rw-r--r-- | ui/vnc-ws.c | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c index c0c29a5119..ffaab57550 100644 --- a/ui/vnc-auth-vencrypt.c +++ b/ui/vnc-auth-vencrypt.c @@ -65,16 +65,17 @@ static void start_auth_vencrypt_subauth(VncState *vs) } } -static void vnc_tls_handshake_done(Object *source, - Error *err, +static void vnc_tls_handshake_done(QIOTask *task, gpointer user_data) { VncState *vs = user_data; + Error *err = NULL; - if (err) { + if (qio_task_propagate_error(task, &err)) { VNC_DEBUG("Handshake failed %s\n", error_get_pretty(err)); vnc_client_error(vs); + error_free(err); } else { vs->ioc_tag = qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_OUT, vnc_client_io, vs, NULL); diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c index bffb484a8d..f530cd5474 100644 --- a/ui/vnc-ws.c +++ b/ui/vnc-ws.c @@ -24,15 +24,16 @@ #include "io/channel-websock.h" #include "qemu/bswap.h" -static void vncws_tls_handshake_done(Object *source, - Error *err, +static void vncws_tls_handshake_done(QIOTask *task, gpointer user_data) { VncState *vs = user_data; + Error *err = NULL; - if (err) { + if (qio_task_propagate_error(task, &err)) { VNC_DEBUG("Handshake failed %s\n", error_get_pretty(err)); vnc_client_error(vs); + error_free(err); } else { VNC_DEBUG("TLS handshake complete, starting websocket handshake\n"); vs->ioc_tag = qio_channel_add_watch( @@ -83,15 +84,16 @@ gboolean vncws_tls_handshake_io(QIOChannel *ioc G_GNUC_UNUSED, } -static void vncws_handshake_done(Object *source, - Error *err, +static void vncws_handshake_done(QIOTask *task, gpointer user_data) { VncState *vs = user_data; + Error *err = NULL; - if (err) { + if (qio_task_propagate_error(task, &err)) { VNC_DEBUG("Websock handshake failed %s\n", error_get_pretty(err)); vnc_client_error(vs); + error_free(err); } else { VNC_DEBUG("Websock handshake complete, starting VNC protocol\n"); vnc_start_protocol(vs); |