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
8f3d4fde
Commit
8f3d4fde
authored
Jan 18, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Remove deprecated evbuffer_setcb, send WU before buffer gets empty
parent
0872ce27
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
14 deletions
+19
-14
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+0
-13
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+8
-1
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+7
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+4
-0
No files found.
src/shrpx_downstream.cc
View file @
8f3d4fde
...
...
@@ -635,18 +635,6 @@ int Downstream::get_response_state() const
return
response_state_
;
}
namespace
{
void
body_buf_cb
(
evbuffer
*
body
,
size_t
oldlen
,
size_t
newlen
,
void
*
arg
)
{
Downstream
*
downstream
=
reinterpret_cast
<
Downstream
*>
(
arg
);
if
(
newlen
==
0
)
{
if
(
downstream
->
resume_read
(
SHRPX_NO_BUFFER
)
==
-
1
)
{
DLOG
(
WARNING
,
downstream
)
<<
"Sending WINDOW_UPDATE failed"
;
}
}
}
}
// namespace
int
Downstream
::
init_response_body_buf
()
{
if
(
!
response_body_buf_
)
{
...
...
@@ -654,7 +642,6 @@ int Downstream::init_response_body_buf()
if
(
response_body_buf_
==
nullptr
)
{
DIE
();
}
evbuffer_setcb
(
response_body_buf_
,
body_buf_cb
,
this
);
}
return
0
;
}
...
...
src/shrpx_http2_downstream_connection.cc
View file @
8f3d4fde
...
...
@@ -92,7 +92,6 @@ int Http2DownstreamConnection::init_request_body_buf()
if
(
request_body_buf_
==
nullptr
)
{
return
-
1
;
}
evbuffer_setcb
(
request_body_buf_
,
nullptr
,
this
);
}
return
0
;
}
...
...
@@ -212,6 +211,14 @@ ssize_t http2_data_read_callback(nghttp2_session *session,
}
}
}
else
{
// Send WINDOW_UPDATE before buffer is empty to avoid delay
// because of RTT.
if
(
!
downstream
->
get_output_buffer_full
()
&&
downstream
->
get_upstream
()
->
resume_read
(
SHRPX_NO_BUFFER
,
downstream
)
==
-
1
)
{
// In this case, downstream may be deleted.
return
NGHTTP2_ERR_DEFERRED
;
}
break
;
}
}
...
...
src/shrpx_http2_upstream.cc
View file @
8f3d4fde
...
...
@@ -902,6 +902,13 @@ ssize_t downstream_data_read_callback(nghttp2_session *session,
(
downstream
->
get_response_rst_stream_error_code
()));
}
}
// Send WINDOW_UPDATE before buffer is empty to avoid delay because
// of RTT.
if
(
*
eof
!=
1
&&
evbuffer_get_length
(
body
)
<
SHRPX_HTTP2_UPSTREAM_OUTPUT_UPPER_THRES
&&
downstream
->
resume_read
(
SHRPX_NO_BUFFER
)
!=
0
)
{
DLOG
(
WARNING
,
downstream
)
<<
"Sending WINDOW_UPDATE failed"
;
}
if
(
nread
==
0
&&
*
eof
!=
1
)
{
return
NGHTTP2_ERR_DEFERRED
;
}
...
...
src/shrpx_http_downstream_connection.cc
View file @
8f3d4fde
...
...
@@ -457,6 +457,10 @@ int htp_msg_completecb(http_parser *htp)
{
auto
downstream
=
reinterpret_cast
<
Downstream
*>
(
htp
->
data
);
downstream
->
set_response_state
(
Downstream
::
MSG_COMPLETE
);
// Block reading another response message from (broken?)
// server. This callback is not called if the connection is
// tunneled.
downstream
->
pause_read
(
SHRPX_MSG_BLOCK
);
return
downstream
->
get_upstream
()
->
on_downstream_body_complete
(
downstream
);
}
}
// 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