From 498194f6fc39ce96f17f5002aab7b0aa0a5e6f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 24 Dec 2021 15:14:56 +0100 Subject: relay: add zstd compression in weechat protocol Option relay.network.compression_level is renamed to relay.network.compression and is now a percentage between 0 (no compression) to 100 (best compression, slowest). Compression is now disabled by default in weechat protocol and must be enabled via the `handshake` command (option `compression` has been removed from `init` command). --- doc/ja/weechat_relay_protocol.ja.adoc | 48 +++++++++++++++++++---------------- doc/ja/weechat_user.ja.adoc | 5 +++- 2 files changed, 30 insertions(+), 23 deletions(-) (limited to 'doc/ja') diff --git a/doc/ja/weechat_relay_protocol.ja.adoc b/doc/ja/weechat_relay_protocol.ja.adoc index e004d5221..ab4833517 100644 --- a/doc/ja/weechat_relay_protocol.ja.adoc +++ b/doc/ja/weechat_relay_protocol.ja.adoc @@ -112,7 +112,7 @@ _リレー_ プラグインは _IRC プロキシ_ のように振舞います ( [[command_handshake]] === handshake -_WeeChat ≥ 2.9._ +_WeeChat ≥ 2.9, updated in version 3.5._ Perform an handshake between the client and WeeChat: this is required in most cases to know the session settings and prepare the authentication with the @@ -136,10 +136,16 @@ Arguments: *** _sha512_: password salted and hashed with SHA512 algorithm *** _pbkdf2+sha256_: password salted and hashed with PBKDF2 algorithm (using SHA256 hash) *** _pbkdf2+sha512_: password salted and hashed with PBKDF2 algorithm (using SHA512 hash) -** _compression_: compression type: -*** _zlib_: enable _zlib_ compression for messages sent by _relay_ - (enabled by default if _relay_ supports _zlib_ compression) -*** _off_: disable compression +// TRANSLATION MISSING +** _compression_: list of supported compression types supported by the client + (separated by colons and sorted from most important to the fallback value); + if compression is enabled, messages from _relay_ to client are compressed + to save bandwidth; allowed values are: +*** _off_: no compression (default if option is not given) +*** _zlib_: compress with https://zlib.net/[zlib] _(WeeChat ≥ 0.3.7)_ +*** _zstd_: compress with https://facebook.github.io/zstd/[Zstandard]: better + compression and much faster than _zlib_ for both compression and decompression + _(WeeChat ≥ 3.5)_ Notes about option _password_hash_algo_: @@ -178,8 +184,9 @@ WeeChat replies with a hashtable containing the following keys and values: and the user password (the _relay_ nonce + the client nonce is the salt used in the password hash algorithm) * _compression_: compression type: -** _zlib_: messages are compressed with _zlib_ ** _off_: messages are not compressed +** _zlib_: messages are compressed with https://zlib.net/[zlib] +** _zstd_: messages are compressed with https://facebook.github.io/zstd/[Zstandard] [TIP] With WeeChat ≤ 2.8, the command _handshake_ is not implemented, WeeChat silently @@ -205,7 +212,7 @@ htb: { 'password_hash_iterations': '100000', 'totp': 'on', 'nonce': '85B1EE00695A5B254E14F4885538DF0D', - 'compression': 'zlib', + 'compression': 'off', } ---- @@ -225,7 +232,7 @@ htb: { 'password_hash_iterations': '100000', 'totp': 'on', 'nonce': '85B1EE00695A5B254E14F4885538DF0D', - 'compression': 'zlib', + 'compression': 'off', } ---- @@ -245,7 +252,7 @@ htb: { 'password_hash_iterations': '100000', 'totp': 'on', 'nonce': '85B1EE00695A5B254E14F4885538DF0D', - 'compression': 'zlib', + 'compression': 'off', } ---- @@ -257,10 +264,11 @@ the password is "test" in this example: init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440 ---- -* Only "sha256" and "sha512" are supported by the client, disable compression: +* Only "sha256" and "sha512" are supported by the client, enable zstd (preferred) +or zlib compression: ---- -(handshake) handshake password_hash_algo=sha256:sha512,compression=off +(handshake) handshake password_hash_algo=sha256:sha512,compression=zstd:zlib ---- Response: @@ -273,7 +281,7 @@ htb: { 'password_hash_iterations': '100000', 'totp': 'on', 'nonce': '85B1EE00695A5B254E14F4885538DF0D', - 'compression': 'off', + 'compression': 'zstd', } ---- @@ -310,13 +318,6 @@ _handshake_), without warning. ** _totp_: パスワードに加えた二要素認証で利用する時間ベースのワンタイムパスワード (TOTP) (WeeChat の _relay.network.totp_secret_ オプション) _(WeeChat バージョン 2.4 で利用可能)_ -// TRANSLATION MISSING -** _compression_: 圧縮タイプ (*deprecated* since version 2.9, it is kept - for compatibility reasons but should be sent in the - <>): -*** _zlib_: _リレー_ から受信するメッセージに対して _zlib_ 圧縮を使う - (_リレー_ が _zlib_ 圧縮をサポートしている場合、デフォルトで有効化されます) -*** _off_: 圧縮を使わない [NOTE] WeeChat バージョン 1.6 以上の場合、コンマをエスケープすることで value にコンマを設定可能です。例えば @@ -1409,7 +1410,8 @@ quit (このフィールドを含む) * _compression_ (バイト型): フラグ: ** _0x00_: これ以降のデータは圧縮されていません -** _0x01_: これ以降のデータは _zlib_ で圧縮されています +** _0x01_: これ以降のデータは https://zlib.net/[zlib] で圧縮されています +** _0x02_: これ以降のデータは https://facebook.github.io/zstd/[Zstandard] で圧縮されています * _id_ (文字列型、4 バイト + 内容): クライアントが送信した識別子 (コマンド名の前につけられる); コマンドに識別子が含まれない場合は空文字列でも可 (内容を含まない長さゼロの文字列) @@ -1419,8 +1421,10 @@ quit [[message_compression]] === 圧縮 -_compression_ フラグが 0x01 の場合、これ以降の *全ての* データは _zlib_ -で圧縮されているため、処理前に必ず展開してください。 +// TRANSLATION MISSING +If flag _compression_ is equal to 0x01 or 0x02, then *all* data after is compressed +with https://zlib.net/[zlib] or https://facebook.github.io/zstd/[Zstandard], +and therefore must be uncompressed before being processed. [[message_identifier]] === 識別子 diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index 61be32a7d..7b33ff049 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -108,9 +108,12 @@ WeeChat: | pkg-config | | インストール済みライブラリを検出 | libncursesw5-dev ^(2)^ | | ncurses インターフェース | libcurl4-gnutls-dev | | URL 転送 -| zlib1g-dev | | relay プラグインでパケットを圧縮 (weechat プロトコル)、スクリプトプラグイン | libgcrypt20-dev | | 保護データ、IRC SASL 認証 | libgnutls28-dev | 2.2.0 以上 ^(3)^ | IRC サーバへの SSL 接続、IRC SASL 認証 (ECDSA-NIST256P-CHALLENGE) +// TRANSLATION MISSING +| zlib1g-dev | | Compression of messages (WeeChat -> client) with https://zlib.net/[zlib] in relay plugin (weechat protocol), script plugin. +// TRANSLATION MISSING +| libzstd-dev | | Compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard] in relay plugin (weechat protocol). |=== [NOTE] -- cgit v1.2.3