Unverified Commit 68a9815f authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #622 from asilversempirical/allow_large_messages

Allow working around the message size limit
parents b9874e00 5f2dccce
......@@ -354,12 +354,12 @@ TEST(TwoPartyNetwork, HugeMessage) {
auto req = client.methodWithDefaultsRequest();
req.initA(100000000); // 100 MB
KJ_EXPECT_THROW_RECOVERABLE_MESSAGE("larger than the single-message size limit",
KJ_EXPECT_THROW_RECOVERABLE_MESSAGE("larger than our single-message size limit",
req.send().ignoreResult().wait(ioContext.waitScope));
}
// Oversized response fails.
KJ_EXPECT_THROW_RECOVERABLE_MESSAGE("larger than the single-message size limit",
KJ_EXPECT_THROW_RECOVERABLE_MESSAGE("larger than our single-message size limit",
client.getEnormousStringRequest().send().ignoreResult().wait(ioContext.waitScope));
// Connection is still up.
......
......@@ -86,10 +86,10 @@ public:
for (auto& segment: message.getSegmentsForOutput()) {
size += segment.size();
}
KJ_REQUIRE(size < ReaderOptions().traversalLimitInWords, size,
"Trying to send Cap'n Proto message larger than the single-message size limit. The "
"other side probably won't accept it and would abort the connection, so I won't "
"send it.") {
KJ_REQUIRE(size < network.receiveOptions.traversalLimitInWords, size,
"Trying to send Cap'n Proto message larger than our single-message size limit. The "
"other side probably won't accept it (assuming its traversalLimitInWords matches "
"ours) and would abort the connection, so I won't send it.") {
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment