mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
Warned about names a peer doesn't take, Refused a NUL in Python's strings
- Replication: what a link's roles here may send but the peer doesn't take (not in its roles' accept_* there) is skipped as before, and now logged as a warning (the first ten "topic:node" named) once per link, again only when that changes. - Python: every string going to the DLL as a C string (a message, a name, SQL, a path) with a NUL is refused (INVALID_ARGUMENT) rather than cut there, as C# already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -138,6 +138,10 @@ with kitchen:
|
||||
ok, detail = raises(lambda: kitchen.push("x" * (bakashrot.MAX_MESSAGE_SIZE + 1), "logs"), BakaShrotError, "too big",
|
||||
ErrorCode.INVALID_ARGUMENT)
|
||||
check("A message over the limit: refused before sending", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.push("a\0b", "logs"), BakaShrotError, "NUL", ErrorCode.INVALID_ARGUMENT)
|
||||
check("A message with a NUL: refused rather than cut", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.query("SELECT 1\0; DELETE"), BakaShrotError, "NUL", ErrorCode.INVALID_ARGUMENT)
|
||||
check("SQL with a NUL: refused too", ok and kitchen.connected, detail)
|
||||
secret_id = kitchen.push({"s": 1}, "secret")
|
||||
check("Push to another allowed topic", secret_id == 1, secret_id)
|
||||
with lounge:
|
||||
|
||||
Reference in New Issue
Block a user