[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] com =?UTF-8?Q?pecl/database/mysql=5Fxdevapi=3A=20WL=23=31=33=30=30=31=20D?= =?UTF-8?Q?evA
From:       hery ramilison <mysqlre () php ! net>
Date:       2019-11-08 11:42:33
Message-ID: php-mail-9c8c392cbbe5b0cccbb18efddd7ddb2c1325543013 () git ! php ! net
[Download RAW message or body]

Commit:    ff9015b868be3a6b5e7bb0acbbb403eb5d1a0a9a
Author:    Darek Slusarczyk <dariusz.slusarczyk@oracle.com>         Fri, 8 Nov 2019 \
                12:42:33 +0100
Parents:   3036f3a076e13be2c84fee32ba220849560dbca3
Branches:  master

Link:       http://git.php.net/?p=pecl/database/mysql_xdevapi.git;a=commitdiff;h=ff9015b868be3a6b5e7bb0acbbb403eb5d1a0a9a


Log:
WL#13001 DevAPI: Connection compression
- update algorithms: lz4 => lz4_message, deflate => deflate_stream, and new one \
zstd_stream

Bugs:
https://bugs.php.net/13001

Changed paths:
  M  xmysqlnd/xmysqlnd_compression.cc
  M  xmysqlnd/xmysqlnd_compression.h


Diff:
diff --git a/xmysqlnd/xmysqlnd_compression.cc b/xmysqlnd/xmysqlnd_compression.cc
index 7343c69..255aad3 100644
--- a/xmysqlnd/xmysqlnd_compression.cc
+++ b/xmysqlnd/xmysqlnd_compression.cc
@@ -34,10 +34,11 @@ const std::string PROPERTY_ALGORITHM{ "algorithm" };
 const std::string PROPERTY_SERVER_STYLE{ "server_style" };
 const std::string PROPERTY_CLIENT_STYLE{ "client_style" };
 
-const std::string ALGORITHM_LZ4{ "lz4" };
-const std::string ALGORITHM_ZLIB{ "zlib" };
-const std::string ALGORITHM_DEFLATE{ "deflate" };
-const std::string ALGORITHM_ZLIB_DEFLATE{ "deflate" };
+const std::string ALGORITHM_ZSTD_STREAM{ "zstd_stream" };
+const std::string ALGORITHM_LZ4_MESSAGE{ "lz4_message" };
+const std::string ALGORITHM_ZLIB_STREAM{ "zlib_stream" };
+const std::string ALGORITHM_DEFLATE_STREAM{ "deflate_stream" };
+const std::string ALGORITHM_ZLIB_DEFLATE_STREAM{ "deflate_stream" };
 
 const std::string SERVER_STYLE_NONE{ "none" };
 const std::string SERVER_STYLE_SINGLE{ "single" };
@@ -99,9 +100,10 @@ void Gather_capabilities::add_supported_algorithm(const \
util::zvalue& zalgorithm  const std::string& algorithm_name{ \
zalgorithm.to_std_string() };  using name_to_algorithm = std::map<std::string, \
Algorithm, util::iless>;  static const name_to_algorithm algorithm_mapping{
-		{ ALGORITHM_DEFLATE, Algorithm::zlib_deflate },
-		{ ALGORITHM_ZLIB, Algorithm::zlib_deflate },
-		{ ALGORITHM_LZ4, Algorithm::lz4 },
+		{ ALGORITHM_ZSTD_STREAM, Algorithm::zstd_stream },
+		{ ALGORITHM_LZ4_MESSAGE, Algorithm::lz4_message },
+		{ ALGORITHM_DEFLATE_STREAM, Algorithm::zlib_deflate_stream },
+		{ ALGORITHM_ZLIB_STREAM, Algorithm::zlib_deflate_stream },
 	};
 
 	auto it{ algorithm_mapping.find(algorithm_name) };
@@ -251,8 +253,9 @@ std::string Negotiate::to_string(Algorithm algorithm) const
 {
 	using algorithm_to_name = std::map<Algorithm, std::string>;
 	static const algorithm_to_name algorithm_mapping{
-		{ Algorithm::zlib_deflate, ALGORITHM_DEFLATE },
-		{ Algorithm::lz4, ALGORITHM_LZ4 },
+		{ Algorithm::zstd_stream, ALGORITHM_ZSTD_STREAM },
+		{ Algorithm::lz4_message, ALGORITHM_LZ4_MESSAGE },
+		{ Algorithm::zlib_deflate_stream, ALGORITHM_DEFLATE_STREAM },
 	};
 	return algorithm_mapping.at(algorithm);
 }
@@ -345,8 +348,8 @@ bool Setup::negotiate()
 {
 	// algorithms, server styles and client styles in the order how they should be \
negotiated  const Algorithms algorithms{
-		Algorithm::lz4,
-		Algorithm::zlib_deflate
+		Algorithm::lz4_message,
+		Algorithm::zlib_deflate_stream
 	};
 
 	const Server_styles server_styles{
diff --git a/xmysqlnd/xmysqlnd_compression.h b/xmysqlnd/xmysqlnd_compression.h
index 9daebd3..f337870 100644
--- a/xmysqlnd/xmysqlnd_compression.h
+++ b/xmysqlnd/xmysqlnd_compression.h
@@ -33,8 +33,9 @@ namespace compression {
 enum class Algorithm
 {
 	none,
-	zlib_deflate,
-	lz4
+	zstd_stream,
+	lz4_message,
+	zlib_deflate_stream
 };
 
 enum class Server_style {


--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic