couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [17/49] chttpd commit: updated refs/heads/windsor-merge to 554ef74
Date Fri, 01 Aug 2014 09:05:53 GMT
Handle undefined result from process_info

BugzID: 21827


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/e6d115a8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/e6d115a8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/e6d115a8

Branch: refs/heads/windsor-merge
Commit: e6d115a854f399620a00823186656ea56aa44afe
Parents: 6c1f455
Author: Robert Newson <robert.newson@cloudant.com>
Authored: Thu Aug 15 15:21:05 2013 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jul 29 18:03:39 2014 +0100

----------------------------------------------------------------------
 src/chttpd_misc.erl | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/e6d115a8/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 62cd903..12b18f8 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -293,16 +293,20 @@ couch_file_stats() ->
     Candidates = [Pid || {process, Pid} <- M],
     Mailboxes = lists:foldl(
         fun(Pid, Acc) ->
-            PI = process_info(Pid, [message_queue_len, dictionary]),
-            Dictionary = proplists:get_value(dictionary, PI, []),
-            case proplists:get_value('$initial_call', Dictionary) of
-                {couch_file, init, 1} ->
-                    case proplists:get_value(message_queue_len, PI) of
-                        undefined -> Acc;
-                        Len -> [Len|Acc]
-                    end;
-                _  ->
-                    Acc
+            case process_info(Pid, [message_queue_len, dictionary]) of
+                undefined ->
+                    Acc;
+                PI ->
+                    Dictionary = proplists:get_value(dictionary, PI, []),
+                    case proplists:get_value('$initial_call', Dictionary) of
+                        {couch_file, init, 1} ->
+                            case proplists:get_value(message_queue_len, PI) of
+                                undefined -> Acc;
+                                Len -> [Len|Acc]
+                            end;
+                        _  ->
+                            Acc
+                    end
             end
         end, [], Candidates
     ),


Mime
View raw message