Skip to content

smp transport: keep the session when a block is too large to send - #2004

Draft
spaced4ndy wants to merge 1 commit into
simplex-chat:masterfrom
spaced4ndy:fix/smp-oversized-block
Draft

spaced4ndy wants to merge 1 commit into
simplex-chat:masterfrom
spaced4ndy:fix/smp-oversized-block

Conversation

@spaced4ndy

Copy link
Copy Markdown
Contributor

A single command that fits the client's size check but not an encrypted transport block now fails on its own, and the session keeps working.

Transport

  • tPutBlock pads the block before it takes the next send key from the chain, and takes it only for a block that fits. Every block that fits is encrypted to the same bytes as before.
  • Server responses use the same function, so they get the same behaviour.

Tests

  • testLargeCommand ("Short links"): on one client session, LSET with the largest user data that fits an encrypted block succeeds, one byte more returns TELargeMsg, and a following LGET on the same session returns the stored data.
Short links

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants