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
b1905c58
Commit
b1905c58
authored
Nov 04, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: More replacement of spdy with http2
parent
0fcd1430
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
21 deletions
+22
-21
src/app_helper.h
src/app_helper.h
+2
-1
src/shrpx.cc
src/shrpx.cc
+3
-3
src/shrpx_client_handler.h
src/shrpx_client_handler.h
+1
-1
src/shrpx_downstream.h
src/shrpx_downstream.h
+3
-3
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+6
-6
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+2
-2
src/shrpx_log.h
src/shrpx_log.h
+3
-3
src/shrpx_spdy_upstream.cc
src/shrpx_spdy_upstream.cc
+1
-1
src/shrpx_spdy_upstream.h
src/shrpx_spdy_upstream.h
+1
-1
No files found.
src/app_helper.h
View file @
b1905c58
...
...
@@ -94,7 +94,8 @@ std::chrono::steady_clock::time_point get_time();
void
print_timer
();
// Setting true will print characters with ANSI color escape codes
// when printing SPDY frames. This function changes a static variable.
// when printing HTTP2 frames. This function changes a static
// variable.
void
set_color_output
(
bool
f
);
}
// namespace nghttp2
...
...
src/shrpx.cc
View file @
b1905c58
...
...
@@ -344,15 +344,15 @@ void fill_default_config()
mod_config
()
->
private_key_passwd
=
0
;
mod_config
()
->
cert_file
=
0
;
// Read timeout for
SPDY
upstream connection
// Read timeout for
HTTP2
upstream connection
mod_config
()
->
http2_upstream_read_timeout
.
tv_sec
=
180
;
mod_config
()
->
http2_upstream_read_timeout
.
tv_usec
=
0
;
// Read timeout for non-
SPDY
upstream connection
// Read timeout for non-
HTTP2
upstream connection
mod_config
()
->
upstream_read_timeout
.
tv_sec
=
180
;
mod_config
()
->
upstream_read_timeout
.
tv_usec
=
0
;
// Write timeout for
SPDY/non-SPDY
upstream connection
// Write timeout for
HTTP2/non-HTTP2
upstream connection
mod_config
()
->
upstream_write_timeout
.
tv_sec
=
60
;
mod_config
()
->
upstream_write_timeout
.
tv_usec
=
0
;
...
...
src/shrpx_client_handler.h
View file @
b1905c58
...
...
@@ -84,7 +84,7 @@ private:
bool
should_close_after_write_
;
std
::
set
<
DownstreamConnection
*>
dconn_pool_
;
// Shared HTTP2 session for each thread. NULL if backend is not
//
SPDY
. Not deleted by this object.
//
HTTP2
. Not deleted by this object.
Http2Session
*
http2session_
;
// The number of bytes of HTTP/2.0 client connection header to read
size_t
left_connhd_len_
;
...
...
src/shrpx_downstream.h
View file @
b1905c58
...
...
@@ -58,7 +58,7 @@ public:
void
pause_read
(
IOCtrlReason
reason
);
int
resume_read
(
IOCtrlReason
reason
);
void
force_resume_read
();
// Set stream ID for downstream
SPDY
connection.
// Set stream ID for downstream
HTTP2
connection.
void
set_downstream_stream_id
(
int32_t
stream_id
);
int32_t
get_downstream_stream_id
()
const
;
...
...
@@ -213,9 +213,9 @@ private:
Headers
response_headers_
;
bool
response_header_key_prev_
;
// This buffer is used to temporarily store downstream response
// body.
Spdyla
y reads data from this in the callback.
// body.
nghttp2 librar
y reads data from this in the callback.
evbuffer
*
response_body_buf_
;
// RST_STREAM error_code from downstream
SPDY
connection
// RST_STREAM error_code from downstream
HTTP2
connection
nghttp2_error_code
response_rst_stream_error_code_
;
int32_t
recv_window_size_
;
};
...
...
src/shrpx_http2_upstream.cc
View file @
b1905c58
...
...
@@ -45,7 +45,7 @@ using namespace nghttp2;
namespace
shrpx
{
namespace
{
const
size_t
SHRPX_
SPDY
_UPSTREAM_OUTPUT_UPPER_THRES
=
64
*
1024
;
const
size_t
SHRPX_
HTTP2
_UPSTREAM_OUTPUT_UPPER_THRES
=
64
*
1024
;
}
// namespace
namespace
{
...
...
@@ -59,7 +59,7 @@ ssize_t send_callback(nghttp2_session *session,
auto
bev
=
handler
->
get_bev
();
auto
output
=
bufferevent_get_output
(
bev
);
// Check buffer length and return WOULDBLOCK if it is large enough.
if
(
evbuffer_get_length
(
output
)
>
SHRPX_
SPDY
_UPSTREAM_OUTPUT_UPPER_THRES
)
{
if
(
evbuffer_get_length
(
output
)
>
SHRPX_
HTTP2
_UPSTREAM_OUTPUT_UPPER_THRES
)
{
return
NGHTTP2_ERR_WOULDBLOCK
;
}
...
...
@@ -539,7 +539,7 @@ int Http2Upstream::on_read()
nghttp2_session_want_write
(
session_
)
==
0
&&
evbuffer_get_length
(
bufferevent_get_output
(
handler_
->
get_bev
()))
==
0
)
{
if
(
LOG_ENABLED
(
INFO
))
{
ULOG
(
INFO
,
this
)
<<
"No more read/write for this
SPDY
session"
;
ULOG
(
INFO
,
this
)
<<
"No more read/write for this
HTTP2
session"
;
}
rv
=
-
1
;
}
...
...
@@ -565,7 +565,7 @@ int Http2Upstream::send()
nghttp2_session_want_write
(
session_
)
==
0
&&
evbuffer_get_length
(
bufferevent_get_output
(
handler_
->
get_bev
()))
==
0
)
{
if
(
LOG_ENABLED
(
INFO
))
{
ULOG
(
INFO
,
this
)
<<
"No more read/write for this
SPDY
session"
;
ULOG
(
INFO
,
this
)
<<
"No more read/write for this
HTTP2
session"
;
}
rv
=
-
1
;
}
...
...
@@ -590,7 +590,7 @@ void downstream_readcb(bufferevent *bev, void *ptr)
auto
downstream
=
dconn
->
get_downstream
();
auto
upstream
=
static_cast
<
Http2Upstream
*>
(
downstream
->
get_upstream
());
if
(
downstream
->
get_request_state
()
==
Downstream
::
STREAM_CLOSED
)
{
// If upstream
SPDY
stream was closed, we just close downstream,
// If upstream
HTTP2
stream was closed, we just close downstream,
// because there is no consumer now. Downstream connection is also
// closed in this case.
upstream
->
remove_downstream
(
downstream
);
...
...
@@ -1005,7 +1005,7 @@ int Http2Upstream::on_downstream_body(Downstream *downstream,
nghttp2_session_resume_data
(
session_
,
downstream
->
get_stream_id
());
size_t
bodylen
=
evbuffer_get_length
(
body
);
if
(
bodylen
>
SHRPX_
SPDY
_UPSTREAM_OUTPUT_UPPER_THRES
)
{
if
(
bodylen
>
SHRPX_
HTTP2
_UPSTREAM_OUTPUT_UPPER_THRES
)
{
downstream
->
pause_read
(
SHRPX_NO_BUFFER
);
}
...
...
src/shrpx_https_upstream.cc
View file @
b1905c58
...
...
@@ -422,8 +422,8 @@ void https_downstream_readcb(bufferevent *bev, void *ptr)
}
}
}
else
if
(
downstream
->
get_upgraded
())
{
// This path is effectively only taken for
SPDY
downstream
// because only
SPDY
downstream sets response_state to
// This path is effectively only taken for
HTTP2
downstream
// because only
HTTP2
downstream sets response_state to
// MSG_COMPLETE and this function. For HTTP downstream, EOF
// from tunnel connection is handled on
// https_downstream_eventcb.
...
...
src/shrpx_log.h
View file @
b1905c58
...
...
@@ -64,9 +64,9 @@ namespace shrpx {
#define DCLOG(SEVERITY, DCONN) \
(Log(SEVERITY, __FILE__, __LINE__) << "[DCONN:" << DCONN << "] ")
// Downstream
SPDY
session log
#define SSLOG(SEVERITY,
SPDY
) \
(Log(SEVERITY, __FILE__, __LINE__) << "[D
SPDY:" << SPDY
<< "] ")
// Downstream
HTTP2
session log
#define SSLOG(SEVERITY,
HTTP2
) \
(Log(SEVERITY, __FILE__, __LINE__) << "[D
HTTP2:" << HTTP2
<< "] ")
enum
SeverityLevel
{
INFO
,
WARNING
,
ERROR
,
FATAL
...
...
src/shrpx_spdy_upstream.cc
View file @
b1905c58
/*
*
Spdylay - SPDY
Library
*
nghttp2 - HTTP/2.0 C
Library
*
* Copyright (c) 2012 Tatsuhiro Tsujikawa
*
...
...
src/shrpx_spdy_upstream.h
View file @
b1905c58
/*
*
Spdylay - SPDY
Library
*
nghttp2 - HTTP/2.0 C
Library
*
* Copyright (c) 2012 Tatsuhiro Tsujikawa
*
...
...
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