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
e436caf0
Commit
e436caf0
authored
Sep 02, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Don't forward request if response was commited in mruby hook
parent
f0d41a5a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+6
-2
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+8
-4
src/shrpx_mruby.cc
src/shrpx_mruby.cc
+5
-0
No files found.
src/shrpx_http2_upstream.cc
View file @
e436caf0
...
...
@@ -307,6 +307,8 @@ int Http2Upstream::on_request_headers(Downstream *downstream,
downstream
->
set_request_http2_expect_body
(
true
);
}
downstream
->
inspect_http2_request
();
auto
upstream
=
downstream
->
get_upstream
();
auto
handler
=
upstream
->
get_client_handler
();
auto
worker
=
handler
->
get_worker
();
...
...
@@ -314,8 +316,6 @@ int Http2Upstream::on_request_headers(Downstream *downstream,
mruby_ctx
->
run_on_request_proc
(
downstream
);
downstream
->
inspect_http2_request
();
downstream
->
set_request_state
(
Downstream
::
HEADER_COMPLETE
);
if
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_STREAM
)
{
downstream
->
disable_upstream_rtimer
();
...
...
@@ -323,6 +323,10 @@ int Http2Upstream::on_request_headers(Downstream *downstream,
downstream
->
set_request_state
(
Downstream
::
MSG_COMPLETE
);
}
if
(
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
return
0
;
}
start_downstream
(
downstream
);
return
0
;
...
...
src/shrpx_https_upstream.cc
View file @
e436caf0
...
...
@@ -277,8 +277,6 @@ int htp_hdrs_completecb(http_parser *htp) {
auto
worker
=
handler
->
get_worker
();
auto
mruby_ctx
=
worker
->
get_mruby_context
();
mruby_ctx
->
run_on_request_proc
(
downstream
);
downstream
->
inspect_http1_request
();
if
(
downstream
->
get_request_method
()
!=
HTTP_CONNECT
)
{
...
...
@@ -312,6 +310,14 @@ int htp_hdrs_completecb(http_parser *htp) {
}
}
mruby_ctx
->
run_on_request_proc
(
downstream
);
downstream
->
set_request_state
(
Downstream
::
HEADER_COMPLETE
);
if
(
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
return
0
;
}
rv
=
downstream
->
attach_downstream_connection
(
upstream
->
get_client_handler
()
->
get_downstream_connection
(
downstream
));
...
...
@@ -327,8 +333,6 @@ int htp_hdrs_completecb(http_parser *htp) {
return
-
1
;
}
downstream
->
set_request_state
(
Downstream
::
HEADER_COMPLETE
);
return
0
;
}
}
// namespace
...
...
src/shrpx_mruby.cc
View file @
e436caf0
...
...
@@ -30,6 +30,7 @@
#include "shrpx_downstream.h"
#include "shrpx_config.h"
#include "shrpx_mruby_module.h"
#include "shrpx_downstream_connection.h"
#include "template.h"
namespace
shrpx
{
...
...
@@ -77,6 +78,10 @@ int run_request_proc(mrb_state *mrb, Downstream *downstream, RProc *proc) {
downstream
->
index_request_headers
();
}
if
(
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
downstream
->
pop_downstream_connection
();
}
return
rv
;
}
}
// 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