[Spice-devel] [PATCH spice-server 24/30] Use mnemonic for frame type 0

Frediano Ziglio fziglio at redhat.com
Mon Nov 21 12:52:11 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/websocket.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/websocket.c b/server/websocket.c
index 30e487e..d56dc53 100644
--- a/server/websocket.c
+++ b/server/websocket.c
@@ -41,6 +41,8 @@
 #define FIN_FLAG        0x80
 #define TYPE_MASK       0x0F
 
+#define CONTINUATION_FRAME  0x0
+#define TEXT_FRAME      0x1
 #define BINARY_FRAME    0x2
 #define CLOSE_FRAME     0x8
 #define PING_FRAME      0x9
@@ -216,7 +218,7 @@ static void websocket_get_frame_header(websocket_frame_t *frame)
     /* This is a Spice specific optimization.  We don't really
        care about assembling frames fully, so we treat
        a frame in process as a finished frame and pass it along. */
-    if (!fin && frame->type == 0) {
+    if (!fin && frame->type == CONTINUATION_FRAME) {
         frame->type = BINARY_FRAME;
     }
 
-- 
2.7.4



More information about the Spice-devel mailing list