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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2f3392c672cfc2022eee048702a0211999e58fd0e723bc50f0ae1c789a114d9
4
- data.tar.gz: de1740ec0a048c8bbb099ccfdefba9cae7103c022ea06c9d335121aa25c63ece
3
+ metadata.gz: f16791983fbe45585887bb8c4992eca32fcfc5c5fd03ba65c231d27496ffc5b0
4
+ data.tar.gz: 0a3c3a936000adc3b5e85c2e0c9e08ab5ae5df3f59821faa9c77901ae8fa7e4d
5
5
  SHA512:
6
- metadata.gz: bc58535bbe51850ca68b3f7fc24f7bcaf7a154ebb0b90730ad4968e8ad845123c84b6b62c6776e6e286d4fe866c55db45c969b1d33c747af5ff0daa5ab76fb8b
7
- data.tar.gz: 1f380726e3ed288d9b6502b748259cd4f8d1afcbc31910931410eafbb5e778e74c614caea631e04f1a2ea34ebdb8b34bbdeecf45849a221989cd0e50bc573f7b
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.0unreleased
3
+ ## 0.1.12026-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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module NNQ
4
4
  module Zstd
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -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
- send_with_codec(body) { |wire| @sock.send_request(wire) }
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nnq-zstd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger