mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-08-24 17:49:22 +03:00
ovirt: Don't try to use invalid port numbers
If a remote oVirt VM don't specify a port/secure port number, we'd still try to pass it down to spice-gtk, which would then complain that 0 (the default value) isn't a valid port number. This commit make sure we filter out the default port/secure-port value and pass NULL to spice-gtk instead when we get these values.
This commit is contained in:
@ -916,8 +916,12 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
|
||||
"host-subject", &host_subject,
|
||||
"proxy-url", &proxy_url,
|
||||
NULL);
|
||||
gport = g_strdup_printf("%d", port);
|
||||
gtlsport = g_strdup_printf("%d", secure_port);
|
||||
if (port != 0) {
|
||||
gport = g_strdup_printf("%d", port);
|
||||
}
|
||||
if (secure_port != 0) {
|
||||
gtlsport = g_strdup_printf("%d", secure_port);
|
||||
}
|
||||
|
||||
if (ghost == NULL) {
|
||||
g_set_error(&error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
|
||||
|
Reference in New Issue
Block a user