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
660e1ec4
Commit
660e1ec4
authored
Jan 19, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Move backend outbuf threshold to each downstream type
parent
a37bc88f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
6 deletions
+21
-6
src/shrpx_downstream.h
src/shrpx_downstream.h
+0
-2
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+2
-2
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+10
-1
src/shrpx_http2_session.h
src/shrpx_http2_session.h
+4
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+5
-1
No files found.
src/shrpx_downstream.h
View file @
660e1ec4
...
...
@@ -199,8 +199,6 @@ public:
// Change the priority of downstream
int
change_priority
(
int32_t
pri
);
static
const
size_t
OUTPUT_UPPER_THRES
=
64
*
1024
;
private:
Headers
request_headers_
;
Headers
response_headers_
;
...
...
src/shrpx_http2_downstream_connection.cc
View file @
660e1ec4
...
...
@@ -522,8 +522,8 @@ StreamData* Http2DownstreamConnection::detach_stream_data()
bool
Http2DownstreamConnection
::
get_output_buffer_full
()
{
if
(
request_body_buf_
)
{
return
evbuffer_get_length
(
request_body_buf_
)
>=
Downstream
::
OUTPUT_UPPER
_THRES
;
return
http2session_
->
get_outbuf_length
()
+
evbuffer_get_length
(
request_body_buf_
)
>=
Http2Session
::
OUTBUF_MAX
_THRES
;
}
else
{
return
false
;
}
...
...
src/shrpx_http2_session.cc
View file @
660e1ec4
...
...
@@ -697,7 +697,7 @@ ssize_t send_callback(nghttp2_session *session,
auto
bev
=
http2session
->
get_bev
();
auto
output
=
bufferevent_get_output
(
bev
);
// Check buffer length and return WOULDBLOCK if it is large enough.
if
(
evbuffer_get_length
(
output
)
>
Downstream
::
OUTPUT_UPPER
_THRES
)
{
if
(
evbuffer_get_length
(
output
)
>
Http2Session
::
OUTBUF_MAX
_THRES
)
{
return
NGHTTP2_ERR_WOULDBLOCK
;
}
...
...
@@ -1369,4 +1369,13 @@ int Http2Session::terminate_session(nghttp2_error_code error_code)
return
0
;
}
size_t
Http2Session
::
get_outbuf_length
()
const
{
if
(
bev_
)
{
return
evbuffer_get_length
(
bufferevent_get_output
(
bev_
));
}
else
{
return
OUTBUF_MAX_THRES
;
}
}
}
// namespace shrpx
src/shrpx_http2_session.h
View file @
660e1ec4
...
...
@@ -104,6 +104,8 @@ public:
int
start_settings_timer
();
void
stop_settings_timer
();
size_t
get_outbuf_length
()
const
;
enum
{
// Disconnected
DISCONNECTED
,
...
...
@@ -118,6 +120,8 @@ public:
// Connected to downstream
CONNECTED
};
static
const
size_t
OUTBUF_MAX_THRES
=
64
*
1024
;
private:
std
::
set
<
Http2DownstreamConnection
*>
dconns_
;
std
::
set
<
StreamData
*>
streams_
;
...
...
src/shrpx_http_downstream_connection.cc
View file @
660e1ec4
...
...
@@ -37,6 +37,10 @@ using namespace nghttp2;
namespace
shrpx
{
namespace
{
const
size_t
OUTBUF_MAX_THRES
=
64
*
1024
;
}
// namespace
// Workaround for the inability for Bufferevent to remove timeout from
// bufferevent. Specify this long timeout instead of removing.
namespace
{
...
...
@@ -371,7 +375,7 @@ void HttpDownstreamConnection::force_resume_read()
bool
HttpDownstreamConnection
::
get_output_buffer_full
()
{
auto
output
=
bufferevent_get_output
(
bev_
);
return
evbuffer_get_length
(
output
)
>=
Downstream
::
OUTPUT_UPPER
_THRES
;
return
evbuffer_get_length
(
output
)
>=
OUTBUF_MAX
_THRES
;
}
namespace
{
...
...
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