anchor.diff:  
   dec_con(GS) ->
       GS#gs{connections=GS#gs.connections - 1}.
  +
  +code_change(_OldVsn, Data, _Extra) ->
  +    {ok, Data}.
  
positive.code: 	%% appmod means the auth headers are undefined, i.e. false.
  	%% TODO: change so that authmods simply return true/false
  	{appmod, _AppMod} ->
  	    handle_auth(ARG, Auth_H, Auth_methods#auth{mod = []});
  	{true, User} -> 
  	    {true, User};
  	true ->
  	    true;
  	{false, _Realm} ->
  	    handle_auth(ARG, Auth_H, Auth_methods#auth{mod = []});
  	_ ->
  	    maybe_auth_log(403, ARG),
  	    false_403
      end;
  
  %% if the headers are undefined we do not need to check Pam or Users
  handle_auth(ARG, undefined, Auth_methods) ->
      handle_auth(ARG, undefined, Auth_methods#auth{pam = false, users= []});
  
  handle_auth(ARG, {User, Password, OrigString}, 
              Auth_methods = #auth{pam = Pam}) when Pam /= false ->
      case yaws_pam:auth(User, Password) of
  	{yes, _} ->
  	    maybe_auth_log({ok, User}, ARG),
  	    true;
  	{no, _Rsn} ->
  	    handle_auth(ARG, {User, Password, OrigString}, 
                          Auth_methods#auth{pam = false})
      end;
  
  
  
  
  handle_auth(ARG, {User, Password, OrigString}, 
              Auth_methods = #auth{users = Users}) when Users /= [] ->
      case member({User, Password}, Users) of
  	true ->
  	    maybe_auth_log({ok, User}, ARG),
  	    true;
  	false ->
  	    handle_auth(ARG, {User, Password, OrigString}, 
                          Auth_methods#auth{users = []})
      end.
  	    
  
  
negative.code:     end.
  
  handle_auth(ARG, _Auth_H, #auth{realm = Realm, 
                                  users=[], pam=false, mod = []}, Ret) ->
      maybe_auth_log({401, Realm}, ARG),
      Ret;
  
  handle_auth(ARG, Auth_H, Auth_methods = #auth{mod = Mod}, Ret) when Mod /= [] ->
      case catch Mod:auth(ARG, Auth_methods) of
  	{'EXIT', _Reason} ->
              L = ?F("authmod crashed ~n~p:auth(~p, ~n ~p) \n"
  