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
e63e775f
Commit
e63e775f
authored
Jul 15, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Simplify BlockedLink management
parent
031fb312
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
27 deletions
+22
-27
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+3
-9
src/shrpx_downstream.h
src/shrpx_downstream.h
+1
-1
src/shrpx_downstream_queue.cc
src/shrpx_downstream_queue.cc
+18
-17
No files found.
src/shrpx_downstream.cc
View file @
e63e775f
...
...
@@ -152,10 +152,6 @@ Downstream::~Downstream() {
DLOG
(
INFO
,
this
)
<<
"Deleting"
;
}
if
(
blocked_link_
)
{
detach_blocked_link
(
blocked_link_
);
}
// check nullptr for unittest
if
(
upstream_
)
{
auto
loop
=
upstream_
->
get_client_handler
()
->
get_loop
();
...
...
@@ -1200,12 +1196,10 @@ void Downstream::attach_blocked_link(BlockedLink *l) {
blocked_link_
=
l
;
}
void
Downstream
::
detach_blocked_link
(
BlockedLink
*
l
)
{
assert
(
blocked_link_
);
assert
(
l
->
downstream
==
this
);
l
->
downstream
=
nullptr
;
BlockedLink
*
Downstream
::
detach_blocked_link
()
{
auto
link
=
blocked_link_
;
blocked_link_
=
nullptr
;
return
link
;
}
void
Downstream
::
add_request_headers_sum
(
size_t
amount
)
{
...
...
src/shrpx_downstream.h
View file @
e63e775f
...
...
@@ -332,7 +332,7 @@ public:
void
set_dispatch_state
(
int
s
);
void
attach_blocked_link
(
BlockedLink
*
l
);
void
detach_blocked_link
(
BlockedLink
*
l
);
BlockedLink
*
detach_blocked_link
(
);
enum
{
EVENT_ERROR
=
0x1
,
...
...
src/shrpx_downstream_queue.cc
View file @
e63e775f
...
...
@@ -131,6 +131,12 @@ Downstream *DownstreamQueue::remove_and_get_blocked(Downstream *downstream) {
if
(
downstream
->
get_dispatch_state
()
==
Downstream
::
DISPATCH_ACTIVE
)
{
--
ent
.
num_active
;
}
else
{
auto
link
=
downstream
->
detach_blocked_link
();
if
(
link
)
{
ent
.
blocked
.
remove
(
link
);
delete
link
;
}
}
if
(
remove_host_entry_if_empty
(
ent
,
host_entries_
,
host
))
{
...
...
@@ -141,24 +147,19 @@ Downstream *DownstreamQueue::remove_and_get_blocked(Downstream *downstream) {
return
nullptr
;
}
for
(
auto
link
=
ent
.
blocked
.
head
;
link
;)
{
auto
next
=
link
->
dlnext
;
if
(
!
link
->
downstream
)
{
// If non-active (e.g., pending) Downstream got deleted,
// link->downstream is nullptr.
ent
.
blocked
.
remove
(
link
);
delete
link
;
link
=
next
;
continue
;
}
auto
next_downstream
=
link
->
downstream
;
next_downstream
->
detach_blocked_link
(
link
);
ent
.
blocked
.
remove
(
link
);
delete
link
;
remove_host_entry_if_empty
(
ent
,
host_entries_
,
host
);
return
next_downstream
;
auto
link
=
ent
.
blocked
.
head
;
if
(
!
link
)
{
return
nullptr
;
}
return
nullptr
;
auto
next_downstream
=
link
->
downstream
;
next_downstream
->
detach_blocked_link
();
ent
.
blocked
.
remove
(
link
);
delete
link
;
remove_host_entry_if_empty
(
ent
,
host_entries_
,
host
);
return
next_downstream
;
}
Downstream
*
DownstreamQueue
::
get_downstreams
()
const
{
...
...
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