MCPcopy Create free account
hub / github.com/F-Stack/f-stack / InsertSession

Method InsertSession

adapter/micro_thread/mt_session.cpp:74–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74int SessionMgr::InsertSession(ISession* session)
75{
76 if (!_hash_map || !session) {
77 MTLOG_ERROR("Mngr not init(%p), or session null(%p)", _hash_map, session);
78 return -100;
79 }
80
81 int flag = session->GetSessionFlag();
82 if (flag & SESSION_INUSE) {
83 MTLOG_ERROR("Session already in hash, bugs, %p, %d", session, flag);
84 return -200;
85 }
86
87 session->SetSessionFlag((int)SESSION_INUSE);
88 return _hash_map->HashInsert(session);
89}
90
91ISession* SessionMgr::FindSession(int session_id)
92{

Callers 1

InitConnEnvMethod · 0.80

Calls 3

GetSessionFlagMethod · 0.80
SetSessionFlagMethod · 0.80
HashInsertMethod · 0.80

Tested by

no test coverage detected