Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fragmented TCP packet handling #487

Merged
merged 8 commits into from
Feb 2, 2023
Merged

Fix fragmented TCP packet handling #487

merged 8 commits into from
Feb 2, 2023

Conversation

adelsz
Copy link
Owner

@adelsz adelsz commented Feb 2, 2023

This fixes an issue with handling of fragmented TCP packets.
The problem was uncovered in #474. The type inference query result for such a big enum sometimes doesn't fit into a single TCP packet so it gets split into two, with the boundary cutting a PGSQL protocol frame in half.
Solution is to concat TCP packets into a single Buffer as we receive them to make them continuous for the parsing routines. Memory is cleaned up by unreferencing the Buffer on PGSQL frame boundaries.

@vercel
Copy link

vercel bot commented Feb 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
pgtyped ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 2, 2023 at 1:15AM (UTC)

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.

1 participant