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
0753fcd6
Commit
0753fcd6
authored
Mar 04, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asio: Add error_code parameter to cancel()
parent
a1402974
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
16 deletions
+16
-16
src/asio_client_request.cc
src/asio_client_request.cc
+1
-1
src/asio_client_request_impl.cc
src/asio_client_request_impl.cc
+1
-1
src/asio_client_request_impl.h
src/asio_client_request_impl.h
+1
-1
src/asio_client_session_impl.cc
src/asio_client_session_impl.cc
+4
-4
src/asio_client_session_impl.h
src/asio_client_session_impl.h
+1
-1
src/asio_client_stream.cc
src/asio_client_stream.cc
+1
-1
src/asio_client_stream.h
src/asio_client_stream.h
+1
-1
src/asio_http2_handler.cc
src/asio_http2_handler.cc
+3
-3
src/asio_http2_handler.h
src/asio_http2_handler.h
+1
-1
src/includes/nghttp2/asio_http2_client.h
src/includes/nghttp2/asio_http2_client.h
+1
-1
src/includes/nghttp2/asio_http2_server.h
src/includes/nghttp2/asio_http2_server.h
+1
-1
No files found.
src/asio_client_request.cc
View file @
0753fcd6
...
...
@@ -38,7 +38,7 @@ request::request() : impl_(make_unique<request_impl>()) {}
request
::~
request
()
{}
void
request
::
cancel
(
)
const
{
impl_
->
cancel
(
);
}
void
request
::
cancel
(
uint32_t
error_code
)
const
{
impl_
->
cancel
(
error_code
);
}
void
request
::
on_response
(
response_cb
cb
)
const
{
impl_
->
on_response
(
std
::
move
(
cb
));
...
...
src/asio_client_request_impl.cc
View file @
0753fcd6
...
...
@@ -33,7 +33,7 @@ namespace client {
request_impl
::
request_impl
()
:
strm_
(
nullptr
)
{}
void
request_impl
::
cancel
(
)
{
strm_
->
cancel
(
);
}
void
request_impl
::
cancel
(
uint32_t
error_code
)
{
strm_
->
cancel
(
error_code
);
}
void
request_impl
::
on_response
(
response_cb
cb
)
{
response_cb_
=
std
::
move
(
cb
);
}
...
...
src/asio_client_request_impl.h
View file @
0753fcd6
...
...
@@ -43,7 +43,7 @@ public:
request_impl
(
const
request_impl
&
)
=
delete
;
request_impl
&
operator
=
(
const
request_impl
&
)
=
delete
;
void
cancel
();
void
cancel
(
uint32_t
error_code
);
void
on_response
(
response_cb
cb
);
void
call_on_response
(
response
&
res
);
...
...
src/asio_client_session_impl.cc
View file @
0753fcd6
...
...
@@ -44,11 +44,11 @@ session_impl::session_impl(boost::asio::io_service &io_service)
writing_
(
false
),
inside_callback_
(
false
)
{}
session_impl
::~
session_impl
()
{
// finish up all active stream
with CANCEL error code
// finish up all active stream
for
(
auto
&
p
:
streams_
)
{
auto
&
strm
=
p
.
second
;
auto
&
req
=
strm
->
request
().
impl
();
req
.
call_on_close
(
NGHTTP2_
CANCEL
);
req
.
call_on_close
(
NGHTTP2_
INTERNAL_ERROR
);
}
nghttp2_session_del
(
session_
);
...
...
@@ -321,9 +321,9 @@ bool session_impl::setup_session() {
return
true
;
}
void
session_impl
::
cancel
(
stream
&
strm
)
{
void
session_impl
::
cancel
(
stream
&
strm
,
uint32_t
error_code
)
{
nghttp2_submit_rst_stream
(
session_
,
NGHTTP2_FLAG_NONE
,
strm
.
stream_id
(),
NGHTTP2_CANCEL
);
error_code
);
signal_write
();
}
...
...
src/asio_client_session_impl.h
View file @
0753fcd6
...
...
@@ -53,7 +53,7 @@ public:
const
connect_cb
&
on_connect
()
const
;
const
error_cb
&
on_error
()
const
;
void
cancel
(
stream
&
strm
);
void
cancel
(
stream
&
strm
,
uint32_t
error_code
);
std
::
unique_ptr
<
stream
>
create_stream
();
std
::
unique_ptr
<
stream
>
pop_stream
(
int32_t
stream_id
);
...
...
src/asio_client_stream.cc
View file @
0753fcd6
...
...
@@ -36,7 +36,7 @@ stream::stream(session_impl *sess) : sess_(sess), stream_id_(0) {
request_
.
impl
().
stream
(
this
);
}
void
stream
::
cancel
(
)
{
sess_
->
cancel
(
*
this
);
}
void
stream
::
cancel
(
uint32_t
error_code
)
{
sess_
->
cancel
(
*
this
,
error_code
);
}
void
stream
::
stream_id
(
int32_t
stream_id
)
{
stream_id_
=
stream_id
;
}
...
...
src/asio_client_stream.h
View file @
0753fcd6
...
...
@@ -44,7 +44,7 @@ public:
stream
(
const
stream
&
)
=
delete
;
stream
&
operator
=
(
const
stream
&
)
=
delete
;
void
cancel
();
void
cancel
(
uint32_t
error_code
);
void
stream_id
(
int32_t
stream_id
);
int32_t
stream_id
()
const
;
...
...
src/asio_http2_handler.cc
View file @
0753fcd6
...
...
@@ -65,7 +65,7 @@ void response::end(read_cb cb) const { impl_->end(std::move(cb)); }
void
response
::
on_close
(
close_cb
cb
)
const
{
impl_
->
on_close
(
std
::
move
(
cb
));
}
void
response
::
cancel
(
)
const
{
impl_
->
cancel
(
);
}
void
response
::
cancel
(
uint32_t
error_code
)
const
{
impl_
->
cancel
(
error_code
);
}
const
response
*
response
::
push
(
boost
::
system
::
error_code
&
ec
,
std
::
string
method
,
std
::
string
path
,
...
...
@@ -145,10 +145,10 @@ void response_impl::call_on_close(uint32_t error_code) {
}
}
void
response_impl
::
cancel
()
{
void
response_impl
::
cancel
(
uint32_t
error_code
)
{
auto
handler
=
stream_
->
handler
();
handler
->
stream_error
(
stream_
->
get_stream_id
(),
NGHTTP2_CANCEL
);
handler
->
stream_error
(
stream_
->
get_stream_id
(),
error_code
);
}
void
response_impl
::
start_response
()
{
...
...
src/asio_http2_handler.h
View file @
0753fcd6
...
...
@@ -79,7 +79,7 @@ public:
void
on_close
(
close_cb
cb
);
void
resume
();
void
cancel
();
void
cancel
(
uint32_t
error_code
);
response
*
push
(
boost
::
system
::
error_code
&
ec
,
std
::
string
method
,
std
::
string
raw_path_query
,
header_map
h
=
{})
const
;
...
...
src/includes/nghttp2/asio_http2_client.h
View file @
0753fcd6
...
...
@@ -72,7 +72,7 @@ public:
void
on_push
(
request_cb
cb
)
const
;
void
on_close
(
close_cb
cb
)
const
;
void
cancel
()
const
;
void
cancel
(
uint32_t
error_code
=
NGHTTP2_INTERNAL_ERROR
)
const
;
const
std
::
string
&
method
()
const
;
...
...
src/includes/nghttp2/asio_http2_server.h
View file @
0753fcd6
...
...
@@ -80,7 +80,7 @@ public:
void
on_close
(
close_cb
cb
)
const
;
void
cancel
()
const
;
void
cancel
(
uint32_t
error_code
=
NGHTTP2_INTERNAL_ERROR
)
const
;
// Resumes deferred response.
void
resume
()
const
;
...
...
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