Commit 9b5f99c3 authored by Adam Jackson's avatar Adam Jackson Committed by Ulrich Sibiller

Zero buffer data in BufAlloc()

Inspired by a pattern in NoMachine's NX. Consistently zeroed buffers compress better with ssh and friends. Note that you'll need to rebuild all your protocol libraries to take advantage of this. Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com> Reviewed-by: 's avatarJeremy Huddleston <jeremyhu@apple.com> Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 13fe4d47
......@@ -617,7 +617,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc);
if (dpy->bufptr + (n) > dpy->bufmax) \
_XFlush (dpy); \
ptr = (type) dpy->bufptr; \
(void)ptr; \
memset(ptr, '\0', n); \
dpy->bufptr += (n);
#define Data16(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment