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
19ee1540
Commit
19ee1540
authored
Oct 22, 2019
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The URL string passed to HttpService::request() must live until the request completes.
parent
8be1ab25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
http-over-capnp.c++
c++/src/capnp/compat/http-over-capnp.c++
+3
-1
No files found.
c++/src/capnp/compat/http-over-capnp.c++
View file @
19ee1540
...
@@ -449,12 +449,13 @@ public:
...
@@ -449,12 +449,13 @@ public:
kj
::
HttpService
&
kjService
)
kj
::
HttpService
&
kjService
)
:
factory
(
factory
),
:
factory
(
factory
),
method
(
validateMethod
(
request
.
getMethod
())),
method
(
validateMethod
(
request
.
getMethod
())),
url
(
kj
::
str
(
request
.
getUrl
())),
headers
(
factory
.
headersToKj
(
request
.
getHeaders
()).
clone
()),
headers
(
factory
.
headersToKj
(
request
.
getHeaders
()).
clone
()),
clientContext
(
kj
::
mv
(
clientContext
)),
clientContext
(
kj
::
mv
(
clientContext
)),
// Note we attach `requestBodyIn` to `task` so that we will implicitly cancel reading
// Note we attach `requestBodyIn` to `task` so that we will implicitly cancel reading
// the request body as soon as the service returns. This is important in particular when
// the request body as soon as the service returns. This is important in particular when
// the request body is not fully consumed, in order to propagate cancellation.
// the request body is not fully consumed, in order to propagate cancellation.
task
(
kjService
.
request
(
method
,
request
.
getUrl
()
,
headers
,
*
requestBodyIn
,
*
this
)
task
(
kjService
.
request
(
method
,
url
,
headers
,
*
requestBodyIn
,
*
this
)
.
attach
(
kj
::
mv
(
requestBodyIn
)))
{}
.
attach
(
kj
::
mv
(
requestBodyIn
)))
{}
KJ_DISALLOW_COPY
(
ServerRequestContextImpl
);
KJ_DISALLOW_COPY
(
ServerRequestContextImpl
);
...
@@ -544,6 +545,7 @@ public:
...
@@ -544,6 +545,7 @@ public:
private
:
private
:
HttpOverCapnpFactory
&
factory
;
HttpOverCapnpFactory
&
factory
;
kj
::
HttpMethod
method
;
kj
::
HttpMethod
method
;
kj
::
String
url
;
kj
::
HttpHeaders
headers
;
kj
::
HttpHeaders
headers
;
capnp
::
HttpService
::
ClientRequestContext
::
Client
clientContext
;
capnp
::
HttpService
::
ClientRequestContext
::
Client
clientContext
;
kj
::
Promise
<
void
>
task
;
kj
::
Promise
<
void
>
task
;
...
...
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