[Spice-devel] [PATCH spice-server 09/30] Avoid to fill header if not needed

Frediano Ziglio fziglio at redhat.com
Mon Nov 21 12:51:56 UTC 2016


---
 server/websocket.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/server/websocket.c b/server/websocket.c
index d35a892..1379487 100644
--- a/server/websocket.c
+++ b/server/websocket.c
@@ -383,10 +383,8 @@ int websocket_write(void *opaque, const guchar *buf, int len, guint64 *remainder
     int rc;
     int header_len;
 
-    memset(header, 0, sizeof(header));
-    header_len = fill_header(header, len);
-
     if (*remainder == 0) {
+        header_len = fill_header(header, len);
         rc = write_cb(opaque, header, header_len);
         if (rc <= 0)
             return rc;
-- 
2.7.4



More information about the Spice-devel mailing list