diff options
Diffstat (limited to '')
| -rw-r--r-- | FAQ | 26 |
1 files changed, 14 insertions, 12 deletions
| @@ -148,13 +148,6 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 148 | format using deflateInit2(). You can also request that inflate decode | 148 | format using deflateInit2(). You can also request that inflate decode |
| 149 | the gzip format using inflateInit2(). Read zlib.h for more details. | 149 | the gzip format using inflateInit2(). Read zlib.h for more details. |
| 150 | 150 | ||
| 151 | Note that you cannot specify special gzip header contents (e.g. a file | ||
| 152 | name or modification date), nor will inflate tell you what was in the | ||
| 153 | gzip header. If you need to customize the header or see what's in it, | ||
| 154 | you can use the raw deflate and inflate operations and the crc32() | ||
| 155 | function and roll your own gzip encoding and decoding. Read the gzip | ||
| 156 | RFC 1952 for details of the header and trailer format. | ||
| 157 | |||
| 158 | 21. Is zlib thread-safe? | 151 | 21. Is zlib thread-safe? |
| 159 | 152 | ||
| 160 | Yes. However any library routines that zlib uses and any application- | 153 | Yes. However any library routines that zlib uses and any application- |
| @@ -295,20 +288,29 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 295 | were downright silly. So now, we simply make sure that the code always | 288 | were downright silly. So now, we simply make sure that the code always |
| 296 | works. | 289 | works. |
| 297 | 290 | ||
| 298 | 36. Will zlib read the (insert any ancient or arcane format here) compressed | 291 | 36. Valgrind (or some similar memory access checker) says that deflate is |
| 292 | performing a conditional jump that depends on an uninitialized value. | ||
| 293 | Isn't that a bug? | ||
| 294 | |||
| 295 | No. That is intentional for performance reasons, and the output of | ||
| 296 | deflate is not affected. This only started showing up recently since | ||
| 297 | zlib 1.2.x uses malloc() by default for allocations, whereas earlier | ||
| 298 | versions used calloc(), which zeros out the allocated memory. | ||
| 299 | |||
| 300 | 37. Will zlib read the (insert any ancient or arcane format here) compressed | ||
| 299 | data format? | 301 | data format? |
| 300 | 302 | ||
| 301 | Probably not. Look in the comp.compression FAQ for pointers to various | 303 | Probably not. Look in the comp.compression FAQ for pointers to various |
| 302 | formats and associated software. | 304 | formats and associated software. |
| 303 | 305 | ||
| 304 | 37. How can I encrypt/decrypt zip files with zlib? | 306 | 38. How can I encrypt/decrypt zip files with zlib? |
| 305 | 307 | ||
| 306 | zlib doesn't support encryption. The original PKZIP encryption is very weak | 308 | zlib doesn't support encryption. The original PKZIP encryption is very weak |
| 307 | and can be broken with freely available programs. To get strong encryption, | 309 | and can be broken with freely available programs. To get strong encryption, |
| 308 | use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. | 310 | use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. |
| 309 | For PKZIP compatible "encryption", look at http://www.info-zip.org/ | 311 | For PKZIP compatible "encryption", look at http://www.info-zip.org/ |
| 310 | 312 | ||
| 311 | 38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? | 313 | 39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? |
| 312 | 314 | ||
| 313 | "gzip" is the gzip format, and "deflate" is the zlib format. They should | 315 | "gzip" is the gzip format, and "deflate" is the zlib format. They should |
| 314 | probably have called the second one "zlib" instead to avoid confusion | 316 | probably have called the second one "zlib" instead to avoid confusion |
| @@ -324,14 +326,14 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 324 | 326 | ||
| 325 | Bottom line: use the gzip format for HTTP 1.1 encoding. | 327 | Bottom line: use the gzip format for HTTP 1.1 encoding. |
| 326 | 328 | ||
| 327 | 39. Does zlib support the new "Deflate64" format introduced by PKWare? | 329 | 40. Does zlib support the new "Deflate64" format introduced by PKWare? |
| 328 | 330 | ||
| 329 | No. PKWare has apparently decided to keep that format proprietary, since | 331 | No. PKWare has apparently decided to keep that format proprietary, since |
| 330 | they have not documented it as they have previous compression formats. | 332 | they have not documented it as they have previous compression formats. |
| 331 | In any case, the compression improvements are so modest compared to other | 333 | In any case, the compression improvements are so modest compared to other |
| 332 | more modern approaches, that it's not worth the effort to implement. | 334 | more modern approaches, that it's not worth the effort to implement. |
| 333 | 335 | ||
| 334 | 40. Can you please sign these lengthy legal documents and fax them back to us | 336 | 41. Can you please sign these lengthy legal documents and fax them back to us |
| 335 | so that we can use your software in our product? | 337 | so that we can use your software in our product? |
| 336 | 338 | ||
| 337 | No. Go away. Shoo. | 339 | No. Go away. Shoo. |
