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
dc982969
Commit
dc982969
authored
Nov 09, 2014
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish implementing RealmGateway -- but needs tests still.
parent
680b6979
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
rpc.c++
c++/src/capnp/rpc.c++
+12
-2
No files found.
c++/src/capnp/rpc.c++
View file @
dc982969
...
@@ -588,13 +588,23 @@ private:
...
@@ -588,13 +588,23 @@ private:
sizeHint
=
sizeHint
.
map
([](
MessageSize
hint
)
{
sizeHint
=
sizeHint
.
map
([](
MessageSize
hint
)
{
++
hint
.
capCount
;
++
hint
.
capCount
;
hint
.
wordCount
+=
sizeInWords
<
RealmGateway
<>::
ImportParams
>
();
hint
.
wordCount
+=
sizeInWords
<
RealmGateway
<>::
ImportParams
>
();
return
hint
;
});
});
auto
request
=
g
->
importRequest
(
sizeHint
);
auto
request
=
g
->
importRequest
(
sizeHint
);
request
.
setCap
(
Persistent
<>::
Client
(
addRef
()));
request
.
setCap
(
Persistent
<>::
Client
(
addRef
()));
return
Request
<
AnyPointer
,
AnyPointer
>
(
request
.
getParams
(),
// Awkwardly, request.initParams() would return a SaveParams struct, but to construct
RequestHook
::
from
(
kj
::
mv
(
request
)));
// the Request<AnyPointer, AnyPointer> to return we need an AnyPointer::Builder, and you
// can't go backwards from a struct builder to an AnyPointer builder. So instead we
// manually get at the pointer by converting the outer request to AnyStruct and then
// pulling the pointer from the pointer section.
auto
pointers
=
toAny
(
request
).
getPointerSection
();
KJ_ASSERT
(
pointers
.
size
()
>=
2
);
auto
paramsPtr
=
pointers
[
1
];
KJ_ASSERT
(
paramsPtr
.
isNull
());
return
Request
<
AnyPointer
,
AnyPointer
>
(
paramsPtr
,
RequestHook
::
from
(
kj
::
mv
(
request
)));
}
}
}
}
...
...
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