dialohq / ocaml-grpc

gRPC library for OCaml
https://dialohq.github.io/ocaml-grpc
BSD 3-Clause "New" or "Revised" License
62 stars 9 forks source link

Fix message extraction behavior for batched messages #33

Closed quernd closed 1 year ago

quernd commented 1 year ago

Fixes #31.

From the gRPC over HTTP2 spec:

DATA frame boundaries have no relation to Length-Prefixed-Message boundaries and implementations should make no assumptions about their alignment.

When multiple messages are batched and read into the buffer, only the first message was extracted. Remaining messages would not be extracted until the next invocation of on_read.

This affects both client and server (only the streaming modes) and all three implementations.

quernd commented 1 year ago

Thanks @tmcgilchrist!