fix: handle multiple message frames inside packet (#143)

Running the gateway as non-tls, but using an external TLS gateway in
kubernetes+istio, I determined that the istio TLS gateway would join
messages frames into a single TCP packet. The packet read code assumed
that a single packet is a message. This is not the case for a TCP
stream, since you don't know how the frames are segmented via proxies,
etc.

The fix turned out more complex that I would have liked, but added a
number of unit tests to cover all the corner cases. Likely fragmentation
was not working correctly as well, as there was some cases that were
previously not handled.

Note that this might address issue #126 as well.
This commit is contained in:
Mike Marchetti
2025-05-06 11:38:16 -04:00
committed by GitHub
parent 6b4e6bdced
commit 20307b9a76
7 changed files with 579 additions and 197 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
go.sum
bin
*.swp