Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
5f2dccce
Commit
5f2dccce
authored
Jan 30, 2018
by
Alex Silverstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow working around the message size limit
parent
b9874e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
rpc-twoparty-test.c++
c++/src/capnp/rpc-twoparty-test.c++
+2
-2
rpc-twoparty.c++
c++/src/capnp/rpc-twoparty.c++
+4
-4
No files found.
c++/src/capnp/rpc-twoparty-test.c++
View file @
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.
...
...
c++/src/capnp/rpc-twoparty.c++
View file @
5f2dccce
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment