diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-05-25 16:01:18 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-06-18 16:32:11 +0200 |
commit | 4154d7028943ca4bf0f1ff2e0480d688fc081fcc (patch) | |
tree | fe166cb9d21905653aed68592166b58f14927ff5 /common/gl_canvas.c | |
parent | 17bbef4df334bd8d98d3960143f229d753b4b0a3 (diff) | |
download | spice-4154d7028943ca4bf0f1ff2e0480d688fc081fcc.tar.gz spice-4154d7028943ca4bf0f1ff2e0480d688fc081fcc.tar.xz spice-4154d7028943ca4bf0f1ff2e0480d688fc081fcc.zip |
Client: Use the autogenerated demarshallers
When a message has been read from the network we now pass it into
the generated demarshaller for the channel. The demarshaller converts
the network data to in-memory structures that is passed on to the
spice internals.
Additionally it also:
* Converts endianness
* Validates sizes of message and any pointers in it
* Localizes offsets (converts them to pointers)
* Checks for zero offsets in messages where they are not supported
Some of this was previously done using custom code in the client, this
is now removed.
Diffstat (limited to 'common/gl_canvas.c')
-rw-r--r-- | common/gl_canvas.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/common/gl_canvas.c b/common/gl_canvas.c index 00caf89e..444fa4bb 100644 --- a/common/gl_canvas.c +++ b/common/gl_canvas.c @@ -115,18 +115,14 @@ static GLCPath get_path(GLCanvas *canvas, void *addr) { GLCPath path = glc_path_create(canvas->glc); uint32_t* data_size = (uint32_t*)addr; - access_test(&canvas->base, data_size, sizeof(uint32_t)); uint32_t more = *data_size; SpicePathSeg* seg = (SpicePathSeg*)(data_size + 1); do { - access_test(&canvas->base, seg, sizeof(SpicePathSeg)); - uint32_t flags = seg->flags; SpicePointFix* point = (SpicePointFix*)seg->data; SpicePointFix* end_point = point + seg->count; - access_test(&canvas->base, point, (unsigned long)end_point - (unsigned long)point); ASSERT(point < end_point); more -= ((unsigned long)end_point - (unsigned long)seg); seg = (SpicePathSeg*)end_point; @@ -183,10 +179,8 @@ static void set_clip(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip) break; case SPICE_CLIP_TYPE_RECTS: { uint32_t *n = (uint32_t *)SPICE_GET_ADDRESS(clip->data); - access_test(&canvas->base, n, sizeof(uint32_t)); SpiceRect *now = (SpiceRect *)(n + 1); SpiceRect *end = now + *n; - access_test(&canvas->base, now, (unsigned long)end - (unsigned long)now); if (*n == 0) { rect.x = rect.y = 0; @@ -810,14 +804,6 @@ static void gl_canvas_group_end(SpiceCanvas *spice_canvas) glc_clear_mask(canvas->glc, GLC_MASK_B); } -static void gl_canvas_set_access_params(SpiceCanvas *spice_canvas, unsigned long base, unsigned long max) -{ -#ifdef SW_CANVAS_ACCESS_TEST - GLCanvas *canvas = (GLCanvas *)spice_canvas; - __canvas_set_access_params(&canvas->base, base, max); -#endif -} - static int need_init = 1; static SpiceCanvasOps gl_canvas_ops; @@ -926,7 +912,6 @@ void gl_canvas_init() //unsafe global function gl_canvas_ops.read_bits = gl_canvas_read_bits; gl_canvas_ops.group_start = gl_canvas_group_start; gl_canvas_ops.group_end = gl_canvas_group_end; - gl_canvas_ops.set_access_params = gl_canvas_set_access_params; gl_canvas_ops.destroy = gl_canvas_destroy; rop3_init(); |