MBOX-Line: From dave at cridland.net  Wed Feb  9 03:26:29 2011
To: imap-protocol@u.washington.edu
From: "Dave Cridland" <dave@cridland.net>
Date: Fri Jun  8 12:34:45 2018
Subject: [Imap-protocol] IMAP4 with deflate
References: <4D5173F0.7030405@digitro.com.br> <2609.1297185090.628987@Sputnik>
	<0D26F971-6164-4242-A89A-DCA329111789@iki.fi>
	<4D526ED7.7010501@digitro.com.br>
	<9734454602.981716440@cridland.net>
	<4D527702.3050302@digitro.com.br>
Message-ID: <6138318213.981717989@cridland.net>

------- Original message -------
> From: Bruno M. Soares <bruno.soares@digitro.com.br>
> To: dave@cridland.net
> Cc: tss@iki.fi, imap-protocol@u.washington.edu
> Sent: 9/2/'11,  11:14
> 
> Yes Dave, calling? "inflateInit2(&strm, -15);" once and later "inflate(&strm, Z_SYNC_FLUSH);" while(strm.avail_out == 0).

The loop is a bit more complicated than that. When avail-out is 0, there's usually more data to be written. You need to wait for avail-in to be zero, and avail-oit to be non-zero.
