anchor.diff:  
   handle_cast({webserver_started, Ref, WebPid}, State) ->
       #state{apps=Apps, servers=Servers} = State,
  -    WebApps = [AppId || {{AppId, WebRef}, _} <- Apps, WebRef==Ref],
  -    WebMon = erlang:monitor(process, WebPid),
  -    Servers1 = [{Ref, WebApps, WebPid, WebMon}|Servers],
  -    {noreply, State#state{servers=Servers1}};
  +    WebApps = [AppId || #app_info{index={AppId, WebRef}} <- Apps, WebRef==Ref],
  +    Server = #server_info{
  +        ref = Ref, 
  +        apps = WebApps, 
  +        pid = WebPid, 
  +        mon = erlang:monitor(process, WebPid)
  +    },
  +    {noreply, State#state{servers=[Server|Servers]}};
   
   handle_cast(stop_all, State) ->
       nksip_webserver_sup:terminate_all(),
  
positive.code:          handle_info/2]).
  -export([ranch_start_link/6, do_stop_server/1]).
  
  -compile([export_all]).
  
  
  %% ===================================================================
  %% Public
  
negative.code: 
  handle_info({'DOWN', MRef, process, _Pid, _Reason}, State) ->
      #state{apps=Apps, servers=Servers} = State,
      case lists:keyfind(MRef, #app_info.mon, Apps) of
          #app_info{index={AppId, Ref}} -> 
              {reply, _, State1} = handle_call({stop, AppId, Ref}, none, State),
              {noreply, State1};
          false ->
              case lists:keytake(MRef, #server_info.mon, Servers) of
                  false ->
                      {noreply, State};
                  {value, #server_info{ref=Ref}, Servers1} ->
                      lager:warning("Web server ~p has failed!", [Ref]),
                      {noreply, State#state{servers=Servers1}}
              end
      end.
  
  