fullstorydev / grpchan

Channels for gRPC: custom transports
MIT License
205 stars 23 forks source link

fix bug where trailer msg confused by client for a regular response msg #12

Closed jhump closed 6 years ago

jhump commented 6 years ago

I was trying to integrate changes in this repo into our mono-repo and luckily we had a test that caught this.

I added a test that repros the issue (fails w/out the changes to real code) and then added the fix. This was a regression introduced in #8 (right here).

jhump commented 6 years ago

In retrospect, the size encoding of the last frame should probably have been -sz-1 instead of just -sz. I think I convinced myself that it wasn't necessary because the last frame would never be empty. Oops.