diff options
author | Corentin Chary <corentincj@iksaif.net> | 2010-05-19 09:24:09 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-06-01 12:53:09 -0500 |
commit | a885211eed4e853c64d1419a0113c12048ecd5a1 (patch) | |
tree | 72ec51401215ae87203e9fb79e6539155c37538e /vnc-encoding-zlib.c | |
parent | 161c4f20bfbd54f0b77426adccb68ee831678af0 (diff) |
vnc: return the number of rectangles
Some encodings like tight supports tiling (spliting in
multiple sub-rectangles). So we needed a way to tell
vnc_update_client() how much rectangles are in the buffer.
zlib, raw and hextile always send a full rectangle.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vnc-encoding-zlib.c')
-rw-r--r-- | vnc-encoding-zlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vnc-encoding-zlib.c b/vnc-encoding-zlib.c index 1d4dd1aa47..88ac863a53 100644 --- a/vnc-encoding-zlib.c +++ b/vnc-encoding-zlib.c @@ -116,7 +116,7 @@ static int vnc_zlib_stop(VncState *vs) return zstream->total_out - previous_out; } -void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) +int vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int old_offset, new_offset, bytes_written; @@ -132,13 +132,15 @@ void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) bytes_written = vnc_zlib_stop(vs); if (bytes_written == -1) - return; + return 0; // hack in the size new_offset = vs->output.offset; vs->output.offset = old_offset; vnc_write_u32(vs, bytes_written); vs->output.offset = new_offset; + + return 1; } void vnc_zlib_clear(VncState *vs) |