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

version» Context lines:

pike.git/lib/modules/SSL.pmod/Context.pike:851:   int session_lifetime = 600;      //! Maximum number of sessions to keep in the cache.   int max_sessions = 300;      /* Queue of pairs (time, id), in cronological order */   ADT.Queue active_sessions = ADT.Queue();      mapping(string:Session) session_cache = ([]);    - int session_number; /* Incremented for each session, and used when -  * constructing the session id */ -  +    // Remove sessions older than @[session_lifetime] from the session cache.   void forget_old_sessions()   {    int t = time() - session_lifetime;    array pair;    while ( (pair = [array]active_sessions->peek())    && (pair[0] < t)) {    SSL3_DEBUG_MSG("SSL.Context->forget_old_sessions: "    "garbing session %O due to session_lifetime limit\n",    pair[1]);
pike.git/lib/modules/SSL.pmod/Context.pike:888:      //! 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 = id; -  return s; +  return Session(id);   }      //! 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();    SSL3_DEBUG_MSG("SSL.Context->record_session: "