Say what is true for a TLV too, and cover the to half of the check
Mirror / push (push) Successful in 5s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 31s
Test / test (24) (pull_request) Successful in 29s
Test / test (26) (pull_request) Successful in 30s

This commit is contained in:
2026-09-21 08:20:59 +02:00
parent dc690b912f
commit a7eb4923f5
5 changed files with 38 additions and 35 deletions
+11 -14
View File
@@ -483,24 +483,21 @@ rule and an index of the titles below.
[#16](https://gitea.larvit.se/larvit/smpp-js/pulls/16). 3.4 calls these fields ASCII, so goal 3
settles the read alone — its generous clause is scoped to reading, and its sender clause is strict.
Goal 1 settles the write, being 3.4 as SMSCs actually run it: an operator routing an alphanumeric
sender through the upper half is traffic to keep, and Node's `ascii` write already emitted the low
octet, so `Kaffeé` went out as `4B 61 66 66 65 E9` before this change and goes out as the same
octets after it. Naming the write latin1 is what makes the round trip idempotent, and no peer sees
a change. Goal 2 settles the refusals, both of them a `size()` that would have agreed with a
`write()` that put something else on the wire: a character past `U+00FF` written as its low octet,
and a caller's own `U+0000`, which the peer reads as the end of the field, shifting every mandatory
field behind it under a `command_length` that counted the whole string. Goal 4 settles them twice
over, since for `一`, ` ` and most emoji that low octet is `0x00` and the field went out malformed
on the operator's parser. `wantText()` and
`wantCstringText()` are the only two places that decide it, which is why the `dest_address` and
sender through the upper half is traffic to keep, and Node's `ascii` write already put those octets
on the wire, so naming the write latin1 makes the round trip idempotent and no peer sees a change.
Goal 2 settles the refusals, both of them a `size()` that would have agreed with a `write()` that
put something else on the wire: a character past `U+00FF` written as its low octet, and a caller's
own `U+0000`, which a mandatory field's reader takes as the end of the field. Goal 4 settles them
twice over: for a great many characters that low octet is `0x00`, and the PDU went out malformed
on the operator's parser. `wantText()` and `wantCstringText()` are the only two places that decide
it, which is why the `dest_address` and
`unsuccess_sme` structures write their embedded addresses through `cstring.write()` rather than
reaching past it into `writeCstring()`. Rejected: reading latin1 and leaving the write spelled
ASCII, which leaves two halves agreeing only by accident. Rejected: refusing the upper half on send
to stay strict to 3.4's ASCII, which would be a new restriction taking away traffic this library
already sends and operators already accept, on no defect; whether an SMSC wants a non-ASCII sender
stays its own call, answered as `ESME_RINVSRCADR`. Rejected:
refusing `U+0000` in every text field, which would buy one spelling by taking a legitimate octet
away from the length-prefixed Octet String, whose length octet is what ends it.
already sends and operators already accept, on no defect. Rejected: refusing `U+0000` in every
text field, which would buy one spelling by taking a legitimate octet away from the
length-prefixed Octet String, whose length octet is what ends it.
## The session's life