Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 655203 Details for
Bug 874698
[spice - remote viewer] Can't open console to VM on 5.9 host "Unable connect to the graphic server"
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
last patch
0001-channel-switch-to-protocol-1-on-error-during-link-ti.patch (text/plain), 4.85 KB, created by
Marc-Andre Lureau
on 2012-11-30 19:37:12 UTC
(
hide
)
Description:
last patch
Filename:
MIME Type:
Creator:
Marc-Andre Lureau
Created:
2012-11-30 19:37:12 UTC
Size:
4.85 KB
patch
obsolete
>From 471c3714363abe5963b013ea24cd137ff57eb283 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com> >Date: Tue, 27 Nov 2012 20:17:13 +0100 >Subject: [PATCH spice-gtk] channel: switch to protocol 1 on error during > link-time > >The Spice server doesn't seem to wait until all data are received by >remote before closing the socket (SO_LINGER). Under special racy >conditions, the client may not have received the link reply indicating >the server protocol version which allows it to reconnect >appropriately. > >It happens on local network with Windows sockets (WSAECONNRESET). To >workaround that issue, let's try to reconnect with protocol 1 when a >socket error is encoutered during link time. >--- > gtk/spice-channel.c | 61 ++++++++++++++++++++++++++++++++--------------------- > 1 file changed, 37 insertions(+), 24 deletions(-) > >diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c >index 54d406d..cb4bbcb 100644 >--- a/gtk/spice-channel.c >+++ b/gtk/spice-channel.c >@@ -1157,6 +1157,15 @@ static void spice_channel_send_link(SpiceChannel *channel) > free(buffer); > } > >+static void spice_channel_switch_protocol(SpiceChannel *channel, gint version) >+{ >+ SpiceChannelPrivate *c = channel->priv; >+ >+ g_object_set(c->session, "protocol", version, NULL); >+ SPICE_CHANNEL_GET_CLASS(channel)->channel_disconnect(channel); >+ spice_channel_connect(channel); >+} >+ > /* coroutine context */ > static void spice_channel_recv_link_hdr(SpiceChannel *channel) > { >@@ -1165,33 +1174,25 @@ static void spice_channel_recv_link_hdr(SpiceChannel *channel) > > rc = spice_channel_read(channel, &c->peer_hdr, sizeof(c->peer_hdr)); > if (rc != sizeof(c->peer_hdr)) { >- g_critical("incomplete link header (%d/%" G_GSIZE_FORMAT ")", >- rc, sizeof(c->peer_hdr)); >+ g_warning("incomplete link header (%d/%" G_GSIZE_FORMAT ")", >+ rc, sizeof(c->peer_hdr)); > goto error; > } > if (c->peer_hdr.magic != SPICE_MAGIC) { >- g_critical("invalid SPICE_MAGIC!"); >+ g_warning("invalid SPICE_MAGIC!"); > goto error; > } > > SPICE_DEBUG("Peer version: %d:%d", c->peer_hdr.major_version, c->peer_hdr.minor_version); > if (c->peer_hdr.major_version != c->link_hdr.major_version) { >- if (c->peer_hdr.major_version == 1) { >- /* enter spice 0.4 mode */ >- g_object_set(c->session, "protocol", 1, NULL); >- SPICE_DEBUG("%s: switching to protocol 1 (spice 0.4)", c->name); >- SPICE_CHANNEL_GET_CLASS(channel)->channel_disconnect(channel); >- spice_channel_connect(channel); >- return; >- } >- g_critical("major mismatch (got %d, expected %d)", >- c->peer_hdr.major_version, c->link_hdr.major_version); >+ g_warning("major mismatch (got %d, expected %d)", >+ c->peer_hdr.major_version, c->link_hdr.major_version); > goto error; > } > > c->peer_msg = spice_malloc(c->peer_hdr.size); > if (c->peer_msg == NULL) { >- g_critical("invalid peer header size: %u", c->peer_hdr.size); >+ g_warning("invalid peer header size: %u", c->peer_hdr.size); > goto error; > } > >@@ -1199,6 +1200,15 @@ static void spice_channel_recv_link_hdr(SpiceChannel *channel) > return; > > error: >+ /* Windows socket seems to give early CONNRESET errors. The server >+ does not linger when closing the socket if the protocol is >+ incompatible. Try with the oldest protocol in this case: */ >+ if (c->link_hdr.major_version != 1) { >+ SPICE_DEBUG("%s: error, switching to protocol 1 (spice 0.4)", c->name); >+ spice_channel_switch_protocol(channel, 1); >+ return; >+ } >+ > emit_main_context(channel, SPICE_CHANNEL_EVENT, SPICE_CHANNEL_ERROR_LINK); > } > >@@ -2050,8 +2060,19 @@ static gboolean spice_channel_iterate(SpiceChannel *channel) > #endif > } while (ret == 0); /* ret == 0 means no IO condition, but woken up */ > >- if (ret & (G_IO_ERR|G_IO_HUP)) { >- SPICE_DEBUG("got socket error before read(): %d", ret); >+ if (ret & G_IO_IN) { >+ do >+ SPICE_CHANNEL_GET_CLASS(channel)->iterate_read(channel); >+#if HAVE_SASL >+ while (c->sasl_decoded != NULL); >+#else >+ while (FALSE); >+#endif >+ } >+ >+ if (c->state > SPICE_CHANNEL_STATE_CONNECTING && >+ ret & (G_IO_ERR|G_IO_HUP)) { >+ SPICE_DEBUG("got socket error: %d", ret); > emit_main_context(channel, SPICE_CHANNEL_EVENT, > c->state == SPICE_CHANNEL_STATE_READY ? > SPICE_CHANNEL_ERROR_IO : SPICE_CHANNEL_ERROR_LINK); >@@ -2059,14 +2080,6 @@ static gboolean spice_channel_iterate(SpiceChannel *channel) > return FALSE; > } > >- do >- SPICE_CHANNEL_GET_CLASS(channel)->iterate_read(channel); >-#if HAVE_SASL >- while (c->sasl_decoded != NULL); >-#else >- while (FALSE); >-#endif >- > return TRUE; > } > >-- >1.7.11.7 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 874698
:
640947
|
652729
|
652866
|
655164
| 655203