pike.git / lib / modules / SSL.pmod / Context.pike

version» Context lines:

pike.git/lib/modules/SSL.pmod/Context.pike:874:    m_delete (session_cache, [string]([array]active_sessions->get())[1]);    }   }      //! Lookup a session identifier in the cache. Returns the   //! corresponding session, or zero if it is not found or caching is   //! disabled.   Session lookup_session(string id)   {    if (use_cache) -  { +     return session_cache[id]; -  } +     else    return 0;   }      //! Create a new session.   Session new_session()   { -  +  string(8bit) id = ""; +  if(use_cache) +  do { +  id = random(32); +  } while( session_cache[id] ); +     Session s = Session(); -  s->identity = (use_cache) ? -  sprintf("PikeSSL3%s", Standards.UUID.make_version4()->encode()) : ""; +  s->identity = id;    return s;   }      //! Add a session to the cache (if caching is enabled).   void record_session(Session s)   {    if (use_cache && s->identity)    {    while (sizeof (active_sessions) >= max_sessions) {    array pair = [array] active_sessions->get();