Message266876
Thanks for your review, Martin. :) I have replied with after thinking and try.
Yes, this is more like a feature request. But for the end user, this behaviour is quite like a bug.
> If we were to add full support of inflateSetDictionary() for raw deflate mode, I imagine it would be a new decompressobj.set_dictionary() method.
I don't support adding a new set_dictionary() method. Right now decompressobj handles raw deflate format, zlib format and gzip format. Adding a set_dictionary() method for raw deflate format seems weird. If we are going to do so, I suggest reorganize the zlib like PHP and nodejs do, separating different formats into different objects.
> I did some quick tests with specifying an unnecessary zdict buffer to the decompressor (when zdict not used for compression), and it doesn’t _seem_ to break anything, but I am not 100% sure.
This patch only affects raw inflate. You have to set wbits negative. If you are decompressing with an unnecessary zdict, I think it ought to emit an error.
With Python background, zlib dictionary is really hard to understand. I think manual doesn't tell much. I understand why zdict is needed until reading https://blog.cloudflare.com/improving-compression-with-preset-deflate-dictionary/. |
|
Date |
User |
Action |
Args |
2016-06-02 05:59:08 | xiang.zhang | set | recipients:
+ xiang.zhang, twouters, gregory.p.smith, nadeem.vawda, martin.panter, Vladimir Mihailenco |
2016-06-02 05:59:08 | xiang.zhang | set | messageid: <1464847148.65.0.593576479364.issue27164@psf.upfronthosting.co.za> |
2016-06-02 05:59:08 | xiang.zhang | link | issue27164 messages |
2016-06-02 05:59:08 | xiang.zhang | create | |
|