This fixes an issue with handling of fragmented TCP packets.
The problem was uncovered in https://github.com/adelsz/pgtyped/issues/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.
This fixes an issue with handling of fragmented TCP packets. The problem was uncovered in https://github.com/adelsz/pgtyped/issues/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.