nnq-zstd 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/lib/nnq/zstd/version.rb +1 -1
- data/lib/nnq/zstd/wrapper.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f16791983fbe45585887bb8c4992eca32fcfc5c5fd03ba65c231d27496ffc5b0
|
|
4
|
+
data.tar.gz: 0a3c3a936000adc3b5e85c2e0c9e08ab5ae5df3f59821faa9c77901ae8fa7e4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 192a11586ae901da1561f54ffe7feb32b61fa499887efb870f926335145f091573b3007797a7d59479267000cc6a162b7d0854b49e237381194b5dcea322821d
|
|
7
|
+
data.tar.gz: b2ce1b1f7a9fcac0feb922c628fc946850186fed5a4e626cf9437c662e3789e2d7cc91b306cf3ded096fac1f669037f46a1011a278188bfeada8b0c227b3b543
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.1.
|
|
3
|
+
## 0.1.1 — 2026-04-16
|
|
4
|
+
|
|
5
|
+
- **`Wrapper#send_request` decodes the reply.** Cooked REQ's
|
|
6
|
+
`send_request` returns the matching reply body, but the wrapper
|
|
7
|
+
used to return it untouched, so a caller doing `nnq req -z`
|
|
8
|
+
against a compressing REP saw the raw wire (a NUL preamble plus
|
|
9
|
+
the uppercase echo, rendered as `....HELLO`) instead of the
|
|
10
|
+
plaintext. `send_request` now runs the reply through
|
|
11
|
+
`Codec#decode` before returning, matching `#receive`.
|
|
12
|
+
- **Regression test** for the above in
|
|
13
|
+
`test/nnq/zstd/wrapper_test.rb` — binds a REP, wraps both ends,
|
|
14
|
+
calls `req.send_request("hello")`, and asserts the returned
|
|
15
|
+
string equals `"HELLO"` and does not start with the NUL
|
|
16
|
+
preamble.
|
|
17
|
+
- **`Gemfile`**: declare `protocol-sp` as a path dep under
|
|
18
|
+
`NNQ_DEV=1` so the local nnq path dep resolves.
|
|
19
|
+
|
|
20
|
+
## 0.1.0 — 2026-04-15
|
|
4
21
|
|
|
5
22
|
Initial release.
|
|
6
23
|
|
data/lib/nnq/zstd/version.rb
CHANGED
data/lib/nnq/zstd/wrapper.rb
CHANGED
|
@@ -36,8 +36,20 @@ module NNQ
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
# REQ is cooked: send_request sends and returns the matching
|
|
40
|
+
# reply body. We must decode that reply through the codec too,
|
|
41
|
+
# otherwise the caller sees the raw wire (NUL preamble or zstd
|
|
42
|
+
# magic) instead of the plaintext.
|
|
39
43
|
def send_request(body)
|
|
40
|
-
|
|
44
|
+
wire, dict_frames = @codec.encode(body)
|
|
45
|
+
# Dict frames can't be interleaved on a cooked REQ (strict
|
|
46
|
+
# alternation), so ship them as separate one-shot requests.
|
|
47
|
+
# The peer installs them and replies with an empty body which
|
|
48
|
+
# we discard.
|
|
49
|
+
dict_frames.each { |df| @sock.send_request(df) }
|
|
50
|
+
reply = @sock.send_request(wire)
|
|
51
|
+
return nil if reply.nil?
|
|
52
|
+
@codec.decode(reply)
|
|
41
53
|
end
|
|
42
54
|
|
|
43
55
|
|