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
4bd075de
Commit
4bd075de
authored
Oct 17, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Convert Http2Session state to enum class
parent
b46a3249
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
72 deletions
+80
-72
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+3
-3
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+55
-47
src/shrpx_http2_session.h
src/shrpx_http2_session.h
+22
-22
No files found.
src/shrpx_http2_downstream_connection.cc
View file @
4bd075de
...
...
@@ -71,7 +71,7 @@ Http2DownstreamConnection::~Http2DownstreamConnection() {
error_code
=
NGHTTP2_INTERNAL_ERROR
;
}
if
(
http2session_
->
get_state
()
==
Http2Session
::
CONNECTED
&&
if
(
http2session_
->
get_state
()
==
Http2Session
State
::
CONNECTED
&&
downstream_
->
get_downstream_stream_id
()
!=
-
1
)
{
submit_rst_stream
(
downstream_
,
error_code
);
...
...
@@ -140,7 +140,7 @@ void Http2DownstreamConnection::detach_downstream(Downstream *downstream) {
int
Http2DownstreamConnection
::
submit_rst_stream
(
Downstream
*
downstream
,
uint32_t
error_code
)
{
int
rv
=
-
1
;
if
(
http2session_
->
get_state
()
==
Http2Session
::
CONNECTED
&&
if
(
http2session_
->
get_state
()
==
Http2Session
State
::
CONNECTED
&&
downstream
->
get_downstream_stream_id
()
!=
-
1
)
{
switch
(
downstream
->
get_response_state
())
{
case
DownstreamState
:
:
MSG_RESET
:
...
...
@@ -534,7 +534,7 @@ int Http2DownstreamConnection::resume_read(IOCtrlReason reason,
size_t
consumed
)
{
int
rv
;
if
(
http2session_
->
get_state
()
!=
Http2Session
::
CONNECTED
)
{
if
(
http2session_
->
get_state
()
!=
Http2Session
State
::
CONNECTED
)
{
return
0
;
}
...
...
src/shrpx_http2_session.cc
View file @
4bd075de
This diff is collapsed.
Click to expand it.
src/shrpx_http2_session.h
View file @
4bd075de
...
...
@@ -72,6 +72,25 @@ enum class FreelistZone {
GONE
};
enum
class
Http2SessionState
{
// Disconnected
DISCONNECTED
,
// Connecting proxy and making CONNECT request
PROXY_CONNECTING
,
// Tunnel is established with proxy
PROXY_CONNECTED
,
// Establishing tunnel is failed
PROXY_FAILED
,
// Connecting to downstream and/or performing SSL/TLS handshake
CONNECTING
,
// Connected to downstream
CONNECTED
,
// Connection is started to fail
CONNECT_FAILING
,
// Resolving host name
RESOLVING_NAME
,
};
class
Http2Session
{
public:
Http2Session
(
struct
ev_loop
*
loop
,
SSL_CTX
*
ssl_ctx
,
Worker
*
worker
,
...
...
@@ -135,8 +154,8 @@ public:
ev_io
*
get_wev
();
int
get_state
()
const
;
void
set_state
(
int
state
);
Http2SessionState
get_state
()
const
;
void
set_state
(
Http2SessionState
state
);
void
start_settings_timer
();
void
stop_settings_timer
();
...
...
@@ -218,25 +237,6 @@ public:
bool
get_allow_connect_proto
()
const
;
enum
{
// Disconnected
DISCONNECTED
,
// Connecting proxy and making CONNECT request
PROXY_CONNECTING
,
// Tunnel is established with proxy
PROXY_CONNECTED
,
// Establishing tunnel is failed
PROXY_FAILED
,
// Connecting to downstream and/or performing SSL/TLS handshake
CONNECTING
,
// Connected to downstream
CONNECTED
,
// Connection is started to fail
CONNECT_FAILING
,
// Resolving host name
RESOLVING_NAME
,
};
enum
{
// Connection checking is not required
CONNECTION_CHECK_NONE
,
...
...
@@ -283,7 +283,7 @@ private:
// Resolved IP address if dns parameter is used
std
::
unique_ptr
<
Address
>
resolved_addr_
;
std
::
unique_ptr
<
DNSQuery
>
dns_query_
;
int
state_
;
Http2SessionState
state_
;
int
connection_check_state_
;
FreelistZone
freelist_zone_
;
// true if SETTINGS without ACK is received from peer.
...
...
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