qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix crash when connecting to VNC through websocket
@ 2015-02-22 21:58 Jorge Acereda Maciá
  2015-02-23  7:33 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Jorge Acereda Maciá @ 2015-02-22 21:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, kraxel, aliguori

Connecting to VNC through websocket crashes in vnc_flush() when trying
to acquire a mutex that hasn't been initialized (vnc_init_state(vs)
hasn't been called at this point).
 
Signed-off-by: Jorge Acereda Macia <jacereda@gmail.com>

---
 ui/vnc-ws.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index e304baf..30cb3ae 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -208,7 +208,7 @@ static void vncws_send_handshake_response(VncState *vs, const char* key)
 
     response = g_strdup_printf(WS_HANDSHAKE, accept);
     vnc_write(vs, response, strlen(response));
-    vnc_flush(vs);
+    vnc_client_write_ws(vs);
 
     g_free(accept);
     g_free(response);
-- 
1.9.3 (Apple Git-50)

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] Fix crash when connecting to VNC through websocket
@ 2015-02-24  0:29 Jorge Acereda Maciá
  2015-02-24  6:09 ` Peter Crosthwaite
  0 siblings, 1 reply; 5+ messages in thread
From: Jorge Acereda Maciá @ 2015-02-24  0:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, kraxel, aliguori

Please, forget my previous patch, worked somehow with Chrome but failed with Safari (with a good reason, the sent headers were incorrect). This one should be correct and simpler.

Signed-off-by: Jorge Acereda Macia <jacereda@gmail.com>

---
 ui/vnc-ws.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index e304baf..d75950d 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -207,8 +207,7 @@ static void vncws_send_handshake_response(VncState *vs, const char* key)
     }
 
     response = g_strdup_printf(WS_HANDSHAKE, accept);
-    vnc_write(vs, response, strlen(response));
-    vnc_flush(vs);
+    vnc_client_write_buf(vs, (const uint8_t *)response, strlen(response));
 
     g_free(accept);
     g_free(response);
-- 
1.9.3 (Apple Git-50)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-24 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22 21:58 [Qemu-devel] [PATCH] Fix crash when connecting to VNC through websocket Jorge Acereda Maciá
2015-02-23  7:33 ` Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2015-02-24  0:29 Jorge Acereda Maciá
2015-02-24  6:09 ` Peter Crosthwaite
2015-02-24 16:33   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).