deflatePending not available in zlib on OpenBSD (undefined symbol)

Anatoli me at anatoli.ws
Tue Jun 2 03:48:36 EDT 2020


Cyrus developers,

Is it possible to somehow rework the code in imap/httpd.c lines 158-169
in order to NOT use deflatePending as this func is not available on
OpenBSD? The zlib version there is 1.2.3 and deflatePending appeared in
1.2.5 so the code doesn't compile with --enable-http (undefined symbol:
deflatePending). The packaged version disables http for now.

Is it safe to reduce these lines:

 158         if (!zstrm->avail_out) {
 159             unsigned pending;
 160
 161             zr = deflatePending(zstrm, &pending, Z_NULL);
 162             if (zr != Z_OK) {
 163                 /* something went wrong */
 164                 syslog(LOG_ERR, "zlib deflate error: %d %s", zr,
zstrm->msg);
 165                 return -1;
 166             }
 167
 168             buf_ensure(&txn->zbuf, pending);
 169         }


to something like:

 158         if (!zstrm->avail_out) {
 159             buf_ensure(&txn->zbuf, 256 * 1024);
 160         }

If I understand it correctly, deflatePending in this case is only used
to get the needed buffer size and we could replace it with a hardcoded
buffer size (like in my example of 256K).


Thanks,
Anatoli


More information about the Cyrus-devel mailing list