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
799778af
Commit
799778af
authored
Feb 17, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "nghttpx: Fix request resubmit bug on HTTP/2 backend connection check"
This reverts commit
d45f5a51
.
parent
d45f5a51
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
27 deletions
+13
-27
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+1
-5
src/shrpx_downstream.h
src/shrpx_downstream.h
+0
-6
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+3
-6
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+3
-4
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+2
-2
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+2
-2
src/shrpx_spdy_upstream.cc
src/shrpx_spdy_upstream.cc
+2
-2
No files found.
src/shrpx_downstream.cc
View file @
799778af
...
@@ -122,7 +122,7 @@ Downstream::Downstream(Upstream *upstream, int32_t stream_id, int32_t priority)
...
@@ -122,7 +122,7 @@ Downstream::Downstream(Upstream *upstream, int32_t stream_id, int32_t priority)
request_connection_close_
(
false
),
request_header_key_prev_
(
false
),
request_connection_close_
(
false
),
request_header_key_prev_
(
false
),
request_http2_expect_body_
(
false
),
chunked_response_
(
false
),
request_http2_expect_body_
(
false
),
chunked_response_
(
false
),
response_connection_close_
(
false
),
response_header_key_prev_
(
false
),
response_connection_close_
(
false
),
response_header_key_prev_
(
false
),
expect_final_response_
(
false
)
,
request_pending_
(
false
)
{
expect_final_response_
(
false
)
{
ev_timer_init
(
&
upstream_rtimer_
,
&
upstream_rtimeoutcb
,
0.
,
ev_timer_init
(
&
upstream_rtimer_
,
&
upstream_rtimeoutcb
,
0.
,
get_config
()
->
stream_read_timeout
);
get_config
()
->
stream_read_timeout
);
...
@@ -1064,8 +1064,4 @@ void Downstream::set_request_downstream_host(std::string host) {
...
@@ -1064,8 +1064,4 @@ void Downstream::set_request_downstream_host(std::string host) {
request_downstream_host_
=
std
::
move
(
host
);
request_downstream_host_
=
std
::
move
(
host
);
}
}
void
Downstream
::
set_request_pending
(
bool
f
)
{
request_pending_
=
f
;
}
bool
Downstream
::
get_request_pending
()
const
{
return
request_pending_
;
}
}
// namespace shrpx
}
// namespace shrpx
src/shrpx_downstream.h
View file @
799778af
...
@@ -183,8 +183,6 @@ public:
...
@@ -183,8 +183,6 @@ public:
void
set_request_state
(
int
state
);
void
set_request_state
(
int
state
);
int
get_request_state
()
const
;
int
get_request_state
()
const
;
DefaultMemchunks
*
get_request_buf
();
DefaultMemchunks
*
get_request_buf
();
void
set_request_pending
(
bool
f
);
bool
get_request_pending
()
const
;
// downstream response API
// downstream response API
const
Headers
&
get_response_headers
()
const
;
const
Headers
&
get_response_headers
()
const
;
// Lower the response header field names and indexes response
// Lower the response header field names and indexes response
...
@@ -389,10 +387,6 @@ private:
...
@@ -389,10 +387,6 @@ private:
bool
response_connection_close_
;
bool
response_connection_close_
;
bool
response_header_key_prev_
;
bool
response_header_key_prev_
;
bool
expect_final_response_
;
bool
expect_final_response_
;
// true if downstream request is pending because backend connection
// should be checked before use; currently used only with HTTP/2
// connection.
bool
request_pending_
;
};
};
}
// namespace shrpx
}
// namespace shrpx
...
...
src/shrpx_http2_downstream_connection.cc
View file @
799778af
...
@@ -222,19 +222,16 @@ ssize_t http2_data_read_callback(nghttp2_session *session, int32_t stream_id,
...
@@ -222,19 +222,16 @@ ssize_t http2_data_read_callback(nghttp2_session *session, int32_t stream_id,
int
Http2DownstreamConnection
::
push_request_headers
()
{
int
Http2DownstreamConnection
::
push_request_headers
()
{
int
rv
;
int
rv
;
if
(
!
downstream_
)
{
return
0
;
}
if
(
!
http2session_
->
can_push_request
())
{
if
(
!
http2session_
->
can_push_request
())
{
// The HTTP2 session to the backend has not been established or
// The HTTP2 session to the backend has not been established or
// connection is now being checked. This function will be called
// connection is now being checked. This function will be called
// again just after it is established.
// again just after it is established.
downstream_
->
set_request_pending
(
true
);
http2session_
->
start_checking_connection
();
http2session_
->
start_checking_connection
();
return
0
;
return
0
;
}
}
if
(
!
downstream_
)
{
downstream_
->
set_request_pending
(
false
);
return
0
;
}
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
const
char
*
authority
=
nullptr
,
*
host
=
nullptr
;
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
if
(
!
get_config
()
->
no_host_rewrite
&&
!
get_config
()
->
http2_proxy
&&
...
...
src/shrpx_http2_session.cc
View file @
799778af
...
@@ -113,12 +113,11 @@ void writecb(struct ev_loop *loop, ev_io *w, int revents) {
...
@@ -113,12 +113,11 @@ void writecb(struct ev_loop *loop, ev_io *w, int revents) {
auto
conn
=
static_cast
<
Connection
*>
(
w
->
data
);
auto
conn
=
static_cast
<
Connection
*>
(
w
->
data
);
auto
http2session
=
static_cast
<
Http2Session
*>
(
conn
->
data
);
auto
http2session
=
static_cast
<
Http2Session
*>
(
conn
->
data
);
http2session
->
clear_write_request
();
http2session
->
clear_write_request
();
http2session
->
connection_alive
();
rv
=
http2session
->
do_write
();
rv
=
http2session
->
do_write
();
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
http2session
->
disconnect
(
http2session
->
should_hard_fail
());
http2session
->
disconnect
(
http2session
->
should_hard_fail
());
return
;
}
}
http2session
->
connection_alive
();
}
}
}
// namespace
}
// namespace
...
@@ -1481,8 +1480,8 @@ void Http2Session::connection_alive() {
...
@@ -1481,8 +1480,8 @@ void Http2Session::connection_alive() {
for
(
auto
dconn
:
dconns_
)
{
for
(
auto
dconn
:
dconns_
)
{
auto
downstream
=
dconn
->
get_downstream
();
auto
downstream
=
dconn
->
get_downstream
();
if
(
!
downstream
||
if
(
!
downstream
||
(
downstream
->
get_request_state
()
!=
Downstream
::
INITIAL
&&
(
downstream
->
get_request_state
()
!=
Downstream
::
HEADER_COMPLETE
&&
!
downstream
->
get_request_pending
()
)
||
downstream
->
get_request_state
()
!=
Downstream
::
MSG_COMPLETE
)
||
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
continue
;
continue
;
}
}
...
...
src/shrpx_http2_upstream.cc
View file @
799778af
...
@@ -1476,8 +1476,8 @@ int Http2Upstream::on_downstream_reset(bool no_retry) {
...
@@ -1476,8 +1476,8 @@ int Http2Upstream::on_downstream_reset(bool no_retry) {
for
(
auto
&
ent
:
downstream_queue_
.
get_active_downstreams
())
{
for
(
auto
&
ent
:
downstream_queue_
.
get_active_downstreams
())
{
auto
downstream
=
ent
.
second
.
get
();
auto
downstream
=
ent
.
second
.
get
();
if
((
downstream
->
get_request_state
()
!=
Downstream
::
INITIAL
&&
if
((
downstream
->
get_request_state
()
!=
Downstream
::
HEADER_COMPLETE
&&
!
downstream
->
get_request_pending
()
)
||
downstream
->
get_request_state
()
!=
Downstream
::
MSG_COMPLETE
)
||
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
rst_stream
(
downstream
,
NGHTTP2_INTERNAL_ERROR
);
rst_stream
(
downstream
,
NGHTTP2_INTERNAL_ERROR
);
downstream
->
pop_downstream_connection
();
downstream
->
pop_downstream_connection
();
...
...
src/shrpx_https_upstream.cc
View file @
799778af
...
@@ -839,8 +839,8 @@ void HttpsUpstream::on_handler_delete() {
...
@@ -839,8 +839,8 @@ void HttpsUpstream::on_handler_delete() {
int
HttpsUpstream
::
on_downstream_reset
(
bool
no_retry
)
{
int
HttpsUpstream
::
on_downstream_reset
(
bool
no_retry
)
{
int
rv
;
int
rv
;
if
((
downstream_
->
get_request_state
()
!=
Downstream
::
INITIAL
&&
if
((
downstream_
->
get_request_state
()
!=
Downstream
::
HEADER_COMPLETE
&&
!
downstream_
->
get_request_pending
()
)
||
downstream_
->
get_request_state
()
!=
Downstream
::
MSG_COMPLETE
)
||
downstream_
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
downstream_
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
// Return error so that caller can delete handler
// Return error so that caller can delete handler
return
-
1
;
return
-
1
;
...
...
src/shrpx_spdy_upstream.cc
View file @
799778af
...
@@ -1041,8 +1041,8 @@ int SpdyUpstream::on_downstream_reset(bool no_retry) {
...
@@ -1041,8 +1041,8 @@ int SpdyUpstream::on_downstream_reset(bool no_retry) {
for
(
auto
&
ent
:
downstream_queue_
.
get_active_downstreams
())
{
for
(
auto
&
ent
:
downstream_queue_
.
get_active_downstreams
())
{
auto
downstream
=
ent
.
second
.
get
();
auto
downstream
=
ent
.
second
.
get
();
if
((
downstream
->
get_request_state
()
!=
Downstream
::
INITIAL
&&
if
((
downstream
->
get_request_state
()
!=
Downstream
::
HEADER_COMPLETE
&&
!
downstream
->
get_request_pending
()
)
||
downstream
->
get_request_state
()
!=
Downstream
::
MSG_COMPLETE
)
||
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
downstream
->
get_response_state
()
!=
Downstream
::
INITIAL
)
{
rst_stream
(
downstream
,
SPDYLAY_INTERNAL_ERROR
);
rst_stream
(
downstream
,
SPDYLAY_INTERNAL_ERROR
);
downstream
->
pop_downstream_connection
();
downstream
->
pop_downstream_connection
();
...
...
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