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
cebfdacc
Commit
cebfdacc
authored
Jun 21, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Use user-defined literals for time (hours and minutes)
parent
39f89f4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
src/HttpServer.cc
src/HttpServer.cc
+2
-2
src/shrpx.cc
src/shrpx.cc
+5
-6
src/template.h
src/template.h
+8
-0
No files found.
src/HttpServer.cc
View file @
cebfdacc
...
...
@@ -100,8 +100,8 @@ template <typename Array> void append_nv(Stream *stream, const Array &nva) {
}
// namespace
Config
::
Config
()
:
stream_read_timeout
(
60.
),
stream_write_timeout
(
60.
),
data_ptr
(
nullptr
),
padding
(
0
),
num_worker
(
1
),
max_concurrent_streams
(
100
),
:
stream_read_timeout
(
1
_min
),
stream_write_timeout
(
1
_min
),
data_ptr
(
nullptr
),
padding
(
0
),
num_worker
(
1
),
max_concurrent_streams
(
100
),
header_table_size
(
-
1
),
port
(
0
),
verbose
(
false
),
daemon
(
false
),
verify_client
(
false
),
no_tls
(
false
),
error_gzip
(
false
),
early_response
(
false
),
hexdump
(
false
),
echo_upload
(
false
)
{}
...
...
src/shrpx.cc
View file @
cebfdacc
...
...
@@ -710,8 +710,7 @@ int event_loop() {
}
if
(
auto_tls_ticket_key
)
{
// Renew ticket key every 12hrs
ev_timer_init
(
&
renew_ticket_key_timer
,
renew_ticket_key_cb
,
0.
,
12
*
3600.
);
ev_timer_init
(
&
renew_ticket_key_timer
,
renew_ticket_key_cb
,
0.
,
12
_h
);
renew_ticket_key_timer
.
data
=
conn_handler
.
get
();
ev_timer_again
(
loop
,
&
renew_ticket_key_timer
);
...
...
@@ -831,16 +830,16 @@ void fill_default_config() {
mod_config
()
->
cert_file
=
nullptr
;
// Read timeout for HTTP2 upstream connection
mod_config
()
->
http2_upstream_read_timeout
=
180.
;
mod_config
()
->
http2_upstream_read_timeout
=
3
_min
;
// Read timeout for non-HTTP2 upstream connection
mod_config
()
->
upstream_read_timeout
=
180.
;
mod_config
()
->
upstream_read_timeout
=
3
_min
;
// Write timeout for HTTP2/non-HTTP2 upstream connection
mod_config
()
->
upstream_write_timeout
=
30.
;
// Read/Write timeouts for downstream connection
mod_config
()
->
downstream_read_timeout
=
180.
;
mod_config
()
->
downstream_read_timeout
=
3
_min
;
mod_config
()
->
downstream_write_timeout
=
30.
;
// Read timeout for HTTP/2 stream
...
...
@@ -951,7 +950,7 @@ void fill_default_config() {
mod_config
()
->
host_unix
=
false
;
mod_config
()
->
http2_downstream_connections_per_worker
=
0
;
// ocsp update interval = 14400 secs = 4 hours, borrowed from h2o
mod_config
()
->
ocsp_update_interval
=
14400.
;
mod_config
()
->
ocsp_update_interval
=
4
_h
;
mod_config
()
->
fetch_ocsp_response_file
=
strcopy
(
PKGDATADIR
"/fetch-ocsp-response"
);
mod_config
()
->
no_ocsp
=
false
;
...
...
src/template.h
View file @
cebfdacc
...
...
@@ -145,6 +145,8 @@ template <typename T> void dlist_delete_all(DList<T> &dl) {
}
}
// User-defined literals for K, M, and G (powers of 1024)
constexpr
unsigned
long
long
operator
""
_k
(
unsigned
long
long
k
)
{
return
k
*
1024
;
}
...
...
@@ -157,6 +159,12 @@ constexpr unsigned long long operator"" _g(unsigned long long g) {
return
g
*
1024
*
1024
*
1024
;
}
// User-defined literals for time, converted into double in seconds
constexpr
double
operator
""
_h
(
unsigned
long
long
h
)
{
return
h
*
60
*
60
;
}
constexpr
double
operator
""
_min
(
unsigned
long
long
min
)
{
return
min
*
60
;
}
}
// namespace nghttp2
#endif // TEMPLATE_H
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