mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-02 15:24:57 +01:00
fixed GH #1828: DeflatingStreamBuf::sync() should also flush underlying stream.
This commit is contained in:
parent
ffc97bbed4
commit
70217aa083
@ -176,7 +176,9 @@ int DeflatingStreamBuf::sync()
|
||||
if (BufferedStreamBuf::sync())
|
||||
return -1;
|
||||
|
||||
if (_pOstr && _zstr.next_out)
|
||||
if (_pOstr)
|
||||
{
|
||||
if (_zstr.next_out)
|
||||
{
|
||||
int rc = deflate(&_zstr, Z_SYNC_FLUSH);
|
||||
if (rc != Z_OK) throw IOException(zError(rc));
|
||||
@ -194,6 +196,8 @@ int DeflatingStreamBuf::sync()
|
||||
_zstr.next_out = (unsigned char*) _buffer;
|
||||
_zstr.avail_out = DEFLATE_BUFFER_SIZE;
|
||||
}
|
||||
_pOstr->flush();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user