git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_1@4619
3789f03b-4d11-0410-bbf8-
ca57d06f2519
// fprintf(stderr,"zos flush: avail_in %d\n",zs->avail_in);
+ if (!underlying)
+ throw Exception("ZlibOutStream: underlying OutStream has not been set");
+
while (zs->avail_in != 0) {
do {
if (itemSize > bufSize)
throw Exception("ZlibOutStream overrun: max itemSize exceeded");
+ if (!underlying)
+ throw Exception("ZlibOutStream: underlying OutStream has not been set");
+
while (end - ptr < itemSize) {
zs->next_in = start;
zs->avail_in = ptr - start;
zos->setCompressionLevel(zlibLevel);
zos->writeBytes(buf, length);
zos->flush();
+ zos->setUnderlying(NULL);
os->writeCompactLength(mem_os.length());
os->writeBytes(mem_os.data(), mem_os.length());
}