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
53a41c95
Commit
53a41c95
authored
Jan 21, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Don't call ev_TYPE_set macro while watcher is active
parent
c39f2b2c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
src/shrpx_client_handler.cc
src/shrpx_client_handler.cc
+2
-2
src/shrpx_connect_blocker.cc
src/shrpx_connect_blocker.cc
+4
-0
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+6
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+5
-4
No files found.
src/shrpx_client_handler.cc
View file @
53a41c95
...
...
@@ -583,14 +583,14 @@ struct ev_loop *ClientHandler::get_loop() const {
}
void
ClientHandler
::
reset_upstream_read_timeout
(
ev_tstamp
t
)
{
ev_timer_set
(
&
rt_
,
0.
,
t
)
;
rt_
.
repeat
=
t
;
if
(
ev_is_active
(
&
rt_
))
{
ev_timer_again
(
loop_
,
&
rt_
);
}
}
void
ClientHandler
::
reset_upstream_write_timeout
(
ev_tstamp
t
)
{
ev_timer_set
(
&
wt_
,
0.
,
t
)
;
wt_
.
repeat
=
t
;
if
(
ev_is_active
(
&
wt_
))
{
ev_timer_again
(
loop_
,
&
wt_
);
}
...
...
src/shrpx_connect_blocker.cc
View file @
53a41c95
...
...
@@ -50,6 +50,10 @@ bool ConnectBlocker::blocked() const { return ev_is_active(&timer_); }
void
ConnectBlocker
::
on_success
()
{
sleep_
=
INITIAL_SLEEP
;
}
void
ConnectBlocker
::
on_failure
()
{
if
(
ev_is_active
(
&
timer_
))
{
return
;
}
sleep_
=
std
::
min
(
128.
,
sleep_
*
2
);
LOG
(
WARN
)
<<
"connect failure, start sleeping "
<<
sleep_
;
...
...
src/shrpx_http2_session.cc
View file @
53a41c95
...
...
@@ -385,6 +385,12 @@ int Http2Session::initiate_connection() {
}
}
// rev_ and wev_ could possibly be active here. Since calling
// ev_io_set is not allowed while watcher is active, we have to
// stop them just in case.
ev_io_stop
(
loop_
,
&
rev_
);
ev_io_stop
(
loop_
,
&
wev_
);
ev_io_set
(
&
rev_
,
fd_
,
EV_READ
);
ev_io_set
(
&
wev_
,
fd_
,
EV_WRITE
);
...
...
src/shrpx_http_downstream_connection.cc
View file @
53a41c95
...
...
@@ -212,8 +212,8 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) {
ev_set_cb
(
&
rev_
,
readcb
);
ev_timer_set
(
&
rt_
,
0.
,
get_config
()
->
downstream_read_timeout
)
;
rt_
.
repeat
=
get_config
()
->
downstream_read_timeout
;
ev_timer_again
(
loop_
,
&
rt_
);
// TODO we should have timeout for connection establishment
ev_timer_again
(
loop_
,
&
wt_
);
...
...
@@ -424,10 +424,11 @@ void HttpDownstreamConnection::detach_downstream(Downstream *downstream) {
ev_io_start
(
loop_
,
&
rev_
);
ev_io_stop
(
loop_
,
&
wev_
);
ev_set_cb
(
&
rev_
,
idle_readcb
);
ev_timer_stop
(
loop_
,
&
wt_
);
ev_set_cb
(
&
rev_
,
idle_readcb
);
ev_timer_set
(
&
rt_
,
0.
,
get_config
()
->
downstream_idle_read_timeout
);
rt_
.
repeat
=
get_config
()
->
downstream_idle_read_timeout
;
ev_set_cb
(
&
rt_
,
idle_timeoutcb
);
ev_timer_again
(
loop_
,
&
rt_
);
}
...
...
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