Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
ca1f43df
Commit
ca1f43df
authored
Mar 05, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asio: Export session_impl* from stream rather than delegating everything
parent
9efb62f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
src/asio_client_request_impl.cc
src/asio_client_request_impl.cc
+9
-2
src/asio_client_stream.cc
src/asio_client_stream.cc
+2
-4
src/asio_client_stream.h
src/asio_client_stream.h
+2
-3
No files found.
src/asio_client_request_impl.cc
View file @
ca1f43df
...
...
@@ -25,6 +25,7 @@
#include "asio_client_request_impl.h"
#include "asio_client_stream.h"
#include "asio_client_session_impl.h"
#include "template.h"
namespace
nghttp2
{
...
...
@@ -33,7 +34,10 @@ namespace client {
request_impl
::
request_impl
()
:
strm_
(
nullptr
)
{}
void
request_impl
::
cancel
(
uint32_t
error_code
)
{
strm_
->
cancel
(
error_code
);
}
void
request_impl
::
cancel
(
uint32_t
error_code
)
{
auto
sess
=
strm_
->
session
();
sess
->
cancel
(
*
strm_
,
error_code
);
}
void
request_impl
::
on_response
(
response_cb
cb
)
{
response_cb_
=
std
::
move
(
cb
);
}
...
...
@@ -72,7 +76,10 @@ read_cb::result_type request_impl::call_on_read(uint8_t *buf, std::size_t len,
return
0
;
}
void
request_impl
::
resume
()
{
strm_
->
resume
();
}
void
request_impl
::
resume
()
{
auto
sess
=
strm_
->
session
();
sess
->
resume
(
*
strm_
);
}
void
request_impl
::
header
(
header_map
h
)
{
header_
=
std
::
move
(
h
);
}
...
...
src/asio_client_stream.cc
View file @
ca1f43df
...
...
@@ -36,10 +36,6 @@ stream::stream(session_impl *sess) : sess_(sess), stream_id_(0) {
request_
.
impl
().
stream
(
this
);
}
void
stream
::
cancel
(
uint32_t
error_code
)
{
sess_
->
cancel
(
*
this
,
error_code
);
}
void
stream
::
resume
()
{
sess_
->
resume
(
*
this
);
}
void
stream
::
stream_id
(
int32_t
stream_id
)
{
stream_id_
=
stream_id
;
}
int32_t
stream
::
stream_id
()
const
{
return
stream_id_
;
}
...
...
@@ -48,6 +44,8 @@ request &stream::request() { return request_; }
response
&
stream
::
response
()
{
return
response_
;
}
session_impl
*
stream
::
session
()
const
{
return
sess_
;
}
bool
stream
::
expect_final_response
()
const
{
return
response_
.
status_code
()
/
100
==
1
;
}
...
...
src/asio_client_stream.h
View file @
ca1f43df
...
...
@@ -44,15 +44,14 @@ public:
stream
(
const
stream
&
)
=
delete
;
stream
&
operator
=
(
const
stream
&
)
=
delete
;
void
cancel
(
uint32_t
error_code
);
void
resume
();
void
stream_id
(
int32_t
stream_id
);
int32_t
stream_id
()
const
;
request
&
request
();
response
&
response
();
session_impl
*
session
()
const
;
bool
expect_final_response
()
const
;
private:
...
...
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