Browse Source

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.
Loïc Hoguin 12 years ago
parent
commit
480d48a5dc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ranch_conns_sup.erl

+ 1 - 1
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} ->