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
e820239b
Commit
e820239b
authored
Aug 17, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Implement http_reset_stream and http_send_stop_sending
parent
abe06b43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
src/shrpx_http3_upstream.cc
src/shrpx_http3_upstream.cc
+36
-2
src/shrpx_http3_upstream.h
src/shrpx_http3_upstream.h
+2
-0
No files found.
src/shrpx_http3_upstream.cc
View file @
e820239b
...
@@ -1904,18 +1904,52 @@ namespace {
...
@@ -1904,18 +1904,52 @@ namespace {
int
http_send_stop_sending
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
int
http_send_stop_sending
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
uint64_t
app_error_code
,
void
*
user_data
,
uint64_t
app_error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
stream_user_data
)
{
auto
upstream
=
static_cast
<
Http3Upstream
*>
(
user_data
);
if
(
upstream
->
http_send_stop_sending
(
stream_id
,
app_error_code
)
!=
0
)
{
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
}
return
0
;
return
0
;
}
}
}
// namespace
}
// namespace
int
Http3Upstream
::
http_send_stop_sending
(
int64_t
stream_id
,
uint64_t
app_error_code
)
{
auto
rv
=
ngtcp2_conn_shutdown_stream_read
(
conn_
,
stream_id
,
app_error_code
);
if
(
ngtcp2_err_is_fatal
(
rv
))
{
LOG
(
ERROR
)
<<
"ngtcp2_conn_shutdown_stream_read: "
<<
ngtcp2_strerror
(
rv
);
return
-
1
;
}
return
0
;
}
namespace
{
namespace
{
int
http_reset_stream
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
int
http_reset_stream
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
uint64_t
app_error_code
,
void
*
user_data
,
uint64_t
app_error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
stream_user_data
)
{
auto
upstream
=
static_cast
<
Http3Upstream
*>
(
user_data
);
if
(
upstream
->
http_reset_stream
(
stream_id
,
app_error_code
)
!=
0
)
{
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
}
return
0
;
return
0
;
}
}
}
// namespace
}
// namespace
int
Http3Upstream
::
http_reset_stream
(
int64_t
stream_id
,
uint64_t
app_error_code
)
{
auto
rv
=
ngtcp2_conn_shutdown_stream_write
(
conn_
,
stream_id
,
app_error_code
);
if
(
ngtcp2_err_is_fatal
(
rv
))
{
LOG
(
ERROR
)
<<
"ngtcp2_conn_shutdown_stream_write: "
<<
ngtcp2_strerror
(
rv
);
return
-
1
;
}
return
0
;
}
int
Http3Upstream
::
setup_httpconn
()
{
int
Http3Upstream
::
setup_httpconn
()
{
int
rv
;
int
rv
;
...
@@ -1934,9 +1968,9 @@ int Http3Upstream::setup_httpconn() {
...
@@ -1934,9 +1968,9 @@ int Http3Upstream::setup_httpconn() {
nullptr
,
// begin_trailers
nullptr
,
// begin_trailers
nullptr
,
// recv_trailer
nullptr
,
// recv_trailer
nullptr
,
// end_trailers
nullptr
,
// end_trailers
http_send_stop_sending
,
shrpx
::
http_send_stop_sending
,
shrpx
::
http_end_stream
,
shrpx
::
http_end_stream
,
http_reset_stream
,
shrpx
::
http_reset_stream
,
};
};
nghttp3_settings
settings
;
nghttp3_settings
settings
;
...
...
src/shrpx_http3_upstream.h
View file @
e820239b
...
@@ -138,6 +138,8 @@ public:
...
@@ -138,6 +138,8 @@ public:
const
std
::
vector
<
nghttp3_nv
>
&
nva
)
const
;
const
std
::
vector
<
nghttp3_nv
>
&
nva
)
const
;
int
http_acked_stream_data
(
Downstream
*
downstream
,
size_t
datalen
);
int
http_acked_stream_data
(
Downstream
*
downstream
,
size_t
datalen
);
int
http_shutdown_stream_read
(
int64_t
stream_id
);
int
http_shutdown_stream_read
(
int64_t
stream_id
);
int
http_reset_stream
(
int64_t
stream_id
,
uint64_t
app_error_code
);
int
http_send_stop_sending
(
int64_t
stream_id
,
uint64_t
app_error_code
);
private:
private:
ClientHandler
*
handler_
;
ClientHandler
*
handler_
;
...
...
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