Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The session id was not stored when a new session was created. Hopeful…

…ly this fixes #327.
  • Loading branch information...
commit 8d95dbe88a4344f7d9ea9363055b6be38f71fcac 1 parent 9062cbc
@mmzeeman mmzeeman authored
Showing with 5 additions and 4 deletions.
  1. +1 −1  deps/lager
  2. +4 −3 src/support/z_session_manager.erl
2  deps/lager
@@ -1 +1 @@
-Subproject commit dc750f54173fc0f96a15dabdd4b6ec6f9d93de1b
+Subproject commit 18f1806b4cc92516341d89c3af8fd52101fd9dcd
View
7 src/support/z_session_manager.erl
@@ -284,7 +284,8 @@ ensure_session1(SessionId, SessionPid, PersistId, State) when SessionId =:= unde
error ->
NewSessionPid = spawn_session(PersistId, State#session_srv.context),
NewSessionId = z_ids:id(),
- State1 = store_persist_pid(PersistId, NewSessionPid, store_session_pid(SessionId, NewSessionPid, State)),
+ State1 = store_persist_pid(PersistId, NewSessionPid,
+ store_session_pid(NewSessionId, NewSessionPid, State)),
{ok, new, NewSessionPid, NewSessionId, State1}
end;
ensure_session1(SessionId, SessionPid, _PersistId, State) ->
@@ -324,7 +325,7 @@ erase_session_pid(Pid, State) ->
%% @doc Add the pid to the session state
-spec store_session_pid(session_id(), pid(), #session_srv{}) -> #session_srv{}.
-store_session_pid(SessionId, Pid, State) ->
+store_session_pid(SessionId, Pid, State) when is_list(SessionId) and is_pid(Pid) ->
State#session_srv{
pid2key = dict:store(Pid, SessionId, State#session_srv.pid2key),
key2pid = dict:store(SessionId, Pid, State#session_srv.key2pid)
@@ -333,7 +334,7 @@ store_session_pid(SessionId, Pid, State) ->
%% @doc Add the pid to the persist state
-spec store_persist_pid(persistent_id(), pid(), #session_srv{}) -> #session_srv{}.
-store_persist_pid(PersistId, Pid, State) ->
+store_persist_pid(PersistId, Pid, State) when is_list(PersistId) and is_pid(Pid) ->
State#session_srv{
pid2persist = dict:store(Pid, PersistId, State#session_srv.pid2persist),
persist2pid = dict:store(PersistId, Pid, State#session_srv.persist2pid)
Please sign in to comment.
Something went wrong with that request. Please try again.