aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_conns_sup.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-06-19 16:37:07 +0200
committerLoïc Hoguin <[email protected]>2013-06-19 16:37:07 +0200
commit480d48a5dc6becb4aeb88f61e688deccaa9a1caf (patch)
treed9a09cd0639f0a6203dc96dc7361b36e86101b2a /src/ranch_conns_sup.erl
parent99de5bb9a913dae130d8882b5b09db5de6ea2568 (diff)
downloadranch-480d48a5dc6becb4aeb88f61e688deccaa9a1caf.tar.gz
ranch-480d48a5dc6becb4aeb88f61e688deccaa9a1caf.tar.bz2
ranch-480d48a5dc6becb4aeb88f61e688deccaa9a1caf.zip
Fix which_children call which returned incorrect values
Not everything stored in the process dictionary is a pid, because we use proc_lib. Thanks to the cool spanish girl at the EUC 2013 for highlighting this issue, and sorry I forgot your name.
Diffstat (limited to 'src/ranch_conns_sup.erl')
-rw-r--r--src/ranch_conns_sup.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ranch_conns_sup.erl b/src/ranch_conns_sup.erl
index 2964b8b..0ab4427 100644
--- a/src/ranch_conns_sup.erl
+++ b/src/ranch_conns_sup.erl
@@ -163,7 +163,7 @@ loop(State=#state{parent=Parent, ref=Ref, conn_type=ConnType,
{'$gen_call', {To, Tag}, which_children} ->
Pids = get_keys(true),
Children = [{Protocol, Pid, ConnType, [Protocol]}
- || Pid <- Pids],
+ || Pid <- Pids, is_pid(Pid)],
To ! {Tag, Children},
loop(State, CurConns, NbChildren, Sleepers);
{'$gen_call', {To, Tag}, count_children} ->