Branch: Tag:

2014-11-29

2014-11-29 16:37:00 by Martin Nilsson <nilsson@opera.com>

UUID v4 is essentially just an random string, so let's use random string directly instead.

881:   Session lookup_session(string id)   {    if (use_cache) -  { +     return session_cache[id]; -  } +     else    return 0;   }
891:   //! 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;   }