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
ff64f64e
Commit
ff64f64e
authored
Nov 29, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Faster HTTP/1 frontend
parent
bdd34250
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
src/shrpx_client_handler.cc
src/shrpx_client_handler.cc
+4
-0
src/shrpx_client_handler.h
src/shrpx_client_handler.h
+2
-0
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+9
-9
No files found.
src/shrpx_client_handler.cc
View file @
ff64f64e
...
...
@@ -1278,6 +1278,10 @@ ClientHandler::ReadBuf *ClientHandler::get_rb() { return &rb_; }
void
ClientHandler
::
signal_write
()
{
conn_
.
wlimit
.
startw
();
}
void
ClientHandler
::
signal_write_no_wait
()
{
ev_feed_event
(
conn_
.
loop
,
&
conn_
.
wev
,
EV_WRITE
);
}
RateLimit
*
ClientHandler
::
get_rlimit
()
{
return
&
conn_
.
rlimit
;
}
RateLimit
*
ClientHandler
::
get_wlimit
()
{
return
&
conn_
.
wlimit
;
}
...
...
src/shrpx_client_handler.h
View file @
ff64f64e
...
...
@@ -132,6 +132,8 @@ public:
RateLimit
*
get_wlimit
();
void
signal_write
();
// Use this for HTTP/1 frontend since it produces better result.
void
signal_write_no_wait
();
ev_io
*
get_wev
();
void
setup_upstream_io_callback
();
...
...
src/shrpx_https_upstream.cc
View file @
ff64f64e
...
...
@@ -431,7 +431,7 @@ int htp_hdrs_completecb(http_parser *htp) {
auto
output
=
downstream
->
get_response_buf
();
constexpr
auto
res
=
StringRef
::
from_lit
(
"HTTP/1.1 100 Continue
\r\n\r\n
"
);
output
->
append
(
res
);
handler
->
signal_write
();
handler
->
signal_write
_no_wait
();
}
}
...
...
@@ -477,7 +477,7 @@ int htp_msg_completecb(http_parser *htp) {
// in request phase hook. We only delete and proceed to the
// next request handling (if we don't close the connection). We
// first pause parser here just as we normally do, and call
// signal_write() to run on_write().
// signal_write
_no_wait
() to run on_write().
http_parser_pause
(
htp
,
1
);
return
0
;
...
...
@@ -581,7 +581,7 @@ int HttpsUpstream::on_read() {
if
(
downstream
&&
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
&&
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
}
return
0
;
}
...
...
@@ -595,7 +595,7 @@ int HttpsUpstream::on_read() {
if
(
downstream
&&
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
handler_
->
set_should_close_after_write
(
true
);
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
@@ -621,7 +621,7 @@ int HttpsUpstream::on_read() {
error_reply
(
status_code
);
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
@@ -740,7 +740,7 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) {
}
end:
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
@@ -797,7 +797,7 @@ int HttpsUpstream::downstream_eof(DownstreamConnection *dconn) {
// drop connection.
return
-
1
;
end:
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
@@ -825,7 +825,7 @@ int HttpsUpstream::downstream_error(DownstreamConnection *dconn, int events) {
downstream
->
pop_downstream_connection
();
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
@@ -1194,7 +1194,7 @@ int HttpsUpstream::on_downstream_body_complete(Downstream *downstream) {
int
HttpsUpstream
::
on_downstream_abort_request
(
Downstream
*
downstream
,
unsigned
int
status_code
)
{
error_reply
(
status_code
);
handler_
->
signal_write
();
handler_
->
signal_write
_no_wait
();
return
0
;
}
...
...
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