Metaswitch/sas-client — pull request #40 by mirw (2014-11-11 13:44:40+00:00)
Title: [Reviewer: Ben] Add compressed parameter support

Ben,

Please can you review my enhancement to sas-client to support compressed parameters (via the `SAS::Message::add_compressed_param` method) if zlib is available?

I believe Jim has already discussed this with you but in summary

* I've added a `add_compressed_param` method to `SAS::Message`
* `add_compressed_param` calls through to the new `SAS::Compressor` class to compress text (using zlib)
* `SAS::Compressor` exposes a `get` method that stores the compressor in thread-local data for optimal performance
* I've also added a `SAS::Profile` class, which mirrors the profile defined in the resource bundle and defines a compression dictionary
* all zlib-specific function is in a new `sas_compress.cpp` file - this means that if someone compiles zlib function in and then doesn't use it in their code, they don't need to link against zlib
* to achieve this, I've created a new `sas_internal.h` file which contains common internal SAS definitions, shared between `sas.cpp` and `sas_compress.cpp`
* likewise, UT for the compression is in `source/ut/main_compress.cpp` and I've pulled out common definitions from `source/ut/main.cpp`into `source/ut/sastestutil.h` so that they can be shared
* the `configure` script auto-detects the presence of zlib and configures accordingly
* this is C++-specific (no support for other language bindings) and has been live-tested as part of Project Clearwater.

If you have any questions, please shout. It would be great if you could review this this week - please can you let me know if this won't be possible?

Thanks,

Matt