From: <ale...@us...> - 2014-11-28 13:46:32
|
Revision: 60303 http://sourceforge.net/p/firebird/code/60303 Author: alexpeshkoff Date: 2014-11-28 13:46:29 +0000 (Fri, 28 Nov 2014) Log Message: ----------- Establish uncompressed connection in case of missing zlib Modified Paths: -------------- firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/remote.cpp firebird/trunk/src/remote/remote.h Modified: firebird/trunk/src/remote/inet.cpp =================================================================== --- firebird/trunk/src/remote/inet.cpp 2014-11-28 11:58:08 UTC (rev 60302) +++ firebird/trunk/src/remote/inet.cpp 2014-11-28 13:46:29 UTC (rev 60303) @@ -614,8 +614,11 @@ for (size_t i = 0; i < cnct->p_cnct_count; i++) { cnct->p_cnct_versions[i] = protocols_to_try[i]; - if (compression && cnct->p_cnct_versions[i].p_cnct_version >= PROTOCOL_VERSION13) + if (compression && cnct->p_cnct_versions[i].p_cnct_version >= PROTOCOL_VERSION13 && + rem_port::checkCompression()) + { cnct->p_cnct_versions[i].p_cnct_max_type |= pflag_compress; + } } rem_port* port = inet_try_connect(packet, rdb, file_name, node_name, dpb, config, ref_db_name); Modified: firebird/trunk/src/remote/remote.cpp =================================================================== --- firebird/trunk/src/remote/remote.cpp 2014-11-28 11:58:08 UTC (rev 60302) +++ firebird/trunk/src/remote/remote.cpp 2014-11-28 13:46:29 UTC (rev 60303) @@ -1389,8 +1389,6 @@ z.reset(ModuleLoader::fixAndLoadModule(name)); if (z) symbols(); - if (!z) - (Firebird::Arg::Gds(isc_random) << "Error loading zlib").raise(); } int ZEXPORT (*deflateInit_)(z_stream* strm, int level, const char *version, int stream_size); @@ -1620,10 +1618,19 @@ #endif } +bool rem_port::checkCompression() +{ +#ifdef WIRE_COMPRESS_SUPPORT + return zlib(); +#else + return false; +#endif +} + void rem_port::initCompression() { #ifdef WIRE_COMPRESS_SUPPORT - if (port_protocol >= PROTOCOL_VERSION13 && !port_compressed) + if (port_protocol >= PROTOCOL_VERSION13 && !port_compressed && zlib()) { port_send_stream.zalloc = allocFunc; port_send_stream.zfree = freeFunc; Modified: firebird/trunk/src/remote/remote.h =================================================================== --- firebird/trunk/src/remote/remote.h 2014-11-28 11:58:08 UTC (rev 60302) +++ firebird/trunk/src/remote/remote.h 2014-11-28 13:46:29 UTC (rev 60303) @@ -992,6 +992,7 @@ public: void initCompression(); + static bool checkCompression(); void linkParent(rem_port* const parent); void unlinkParent(); const Firebird::RefPtr<Config>& getPortConfig() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |