79662659

Date: 2025-06-11 21:07:16
Score: 0.5
Natty:
Report link

From the error, I figured not everything was sent when I called request_response.send_response().

To fix this I had to set the max request size and response size when defining the request_reponse Behaviour so it can accept and send larger files.

let codec = cbor::codec::Codec::default()
                .set_request_size_maximum(u64::MAX) // specify max file size
                .set_response_size_maximum(u64::MAX);

let request_response = request_response::cbor::Behaviour::with_codec(
                    codec,
                    [(
                        StreamProtocol::new("/file-exchange/1"),
                        ProtocolSupport::Full,
                    )],
                    request_response::Config::default(),
                );
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Arnold