Exemplo n.º 1
0
Arquivo: PMC_All.cpp Projeto: CCJY/ACE
Protocol_Record *
PMC_All::insert_protocol_info (Protocol_Record &protocol_record)
{
  Protocol_Record *prp = PM_Client::insert_protocol_info (protocol_record);
  int length = ACE_OS::strlen (prp->set_real (ACE::strnew (protocol_record.get_real ())));

  if (length > this->max_key_length)
    this->max_key_length = length;

  return prp;
}
Exemplo n.º 2
0
Protocol_Record *
PMS_All::insert_protocol_info (Protocol_Record &protocol_record)
{
  Protocol_Record *prp = PM_Server::insert_protocol_info (protocol_record);
  passwd *pwent = ACE_OS::getpwnam (prp->get_login ());
  char *cp = (char *) ACE_OS::strchr (prp->set_real
                                      (pwent == 0
                                       ? prp->get_login () :
                                       ACE::strnew (pwent->pw_gecos)),
                                      ',');
  if (cp != 0)
    *cp = '\0';

  return prp;
}
Exemplo n.º 3
0
char *
PM_Client::handle_protocol_entries (const char *cp,
                                    const char *login_name,
                                    const char *real_name)
{
  static Protocol_Record protocol_record (1);
  Drwho_Node *current_node = protocol_record.get_drwho_list ();

  protocol_record.set_login (login_name);
  protocol_record.set_real (real_name);
  current_node->set_inactive_count (ACE_OS::atoi (cp));
  current_node->set_active_count (ACE_OS::atoi (cp = ACE_OS::strchr (cp, ' ') + 1));
  current_node->set_host_name (cp = ACE_OS::strchr (cp, ' ') + 1);

  this->insert_protocol_info (protocol_record);

  return (char *) ACE::strend (cp);
}