Protocol_Record *
HT_Server::insert (const char *key_name, int max_len)
{
  Protocol_Record **prpp = 0;

  // This is tricky...

  for (prpp = &this->hash_table[ACE::hash_pjw (key_name) % this->hash_table_size];
       *prpp != 0 && ACE_OS::strncmp ((*prpp)->get_login (), key_name, max_len) != 0;
       prpp = &(*prpp)->next_)
    continue;

  if (*prpp == 0)
    {
      // Remember, the server must be very careful about stuff it
      // receives from the rwho manager, since it may not be
      // NUL-terminated.  That's why we use ACE::strnnew ()...

      ACE_NEW_RETURN (*prpp,
                      Protocol_Record (ACE::strnnew (key_name,
                                                     max_len),
                                       *prpp),
                      0);
      this->count_++;
    }

  return *prpp;
}
Beispiel #2
0
Protocol_Record *
HT_Client::insert (const char *key_name, int max_len)
{
  Protocol_Record **prpp = 0;

  // This is tricky...

  for (prpp = &this->hash_table[ACE::hash_pjw (key_name) % this->hash_table_size];
       *prpp != 0
         && ACE_OS::strncmp ((*prpp)->get_login (),
                             key_name, max_len) != 0;
       prpp = &(*prpp)->next_)
    continue;

  if (*prpp == 0)
    {
      ACE_NEW_RETURN (*prpp,
                      Protocol_Record (ACE::strnew (key_name),
                                       *prpp),
                      0);
      this->count_++;
    }

  return *prpp;
}
Beispiel #3
0
Single_Lookup::Single_Lookup (const char *usr_name)
{
  ACE_NEW (this->prp_,
           Protocol_Record (ACE::strnew (usr_name)));
}