1

I need to send an RPC with the Rust Cap'n Proto API that exceeds the default message traversal limit. When I try to send the message, I get the following error:

remote exception: <class \'capnp.lib.capnp.KjException
\'>:capnp/arena.c++:130: failed: Exceeded message traversal limit.
See capnp::ReaderOptions.

If I were reading a message using capnp::serialize::read_message, I could provide a ReaderOptions struct specifying a new traversal limit.

However, I am making and sending a request like in the calculator example instead of reading a message directly. How can I set the traversal limit for my request message?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
pdiffley
  • 603
  • 9
  • 18
  • is it possible to adapt the answer you accepted when using pythong and captain proto? https://stackoverflow.com/questions/67374563/how-to-read-a-captain-proto-message-bin-file-without-prematures-eofs – Charlie Parker May 03 '21 at 19:20

1 Answers1

1

You can set it when you construct the VatNetwork:

pub fn new<U>(
    input_stream: T,
    output_stream: U,
    side: Side,
    receive_options: ReaderOptions,
) -> VatNetwork<T>
where
    U: Write + 'static,

https://github.com/capnproto/capnproto-rust/issues/124#issuecomment-468877758

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
  • is it possible to adapt your answer when using pythong and captain proto? https://stackoverflow.com/questions/67374563/how-to-read-a-captain-proto-message-bin-file-without-prematures-eofs – Charlie Parker May 03 '21 at 19:20