예제 #1
0
파일: PM_Client.cpp 프로젝트: asdlei00/ACE
Protocol_Record *
PM_Client::insert_protocol_info (Protocol_Record &protocol_record)
{
  Protocol_Record *prp = this->ss->insert (protocol_record.get_login ());
  Drwho_Node *current_node = protocol_record.get_drwho_list ();
  Drwho_Node *np = this->get_drwho_node (ACE::strnew (current_node->get_host_name ()),
                                         prp->drwho_list_);

  // Update the active and inactive counts.

  if (np->get_active_count () < current_node->get_active_count ())
    {
      np->set_active_count (current_node->get_active_count ());
      prp->is_active_ = 1;
    }

  if (np->get_inactive_count () < current_node->get_inactive_count())
    np->set_inactive_count (current_node->get_inactive_count ());

  return prp;
}
예제 #2
0
Protocol_Record *
PMC_Ruser::insert_protocol_info (Protocol_Record &protocol_record)
{
    Protocol_Record *prp = this->ss->insert (protocol_record.get_host (),
                           MAXHOSTNAMELEN);
    Drwho_Node *current_node = protocol_record.get_drwho_list ();
    Drwho_Node *np = this->get_drwho_node (ACE::strnnew (current_node->get_login_name (),
                                           MAXUSERIDNAMELEN),
                                           prp->drwho_list_);
    int length = ACE_OS::strlen (prp->get_host ());

    np->set_real_name (ACE::strnew (current_node->get_real_name ()));

    if (np->get_active_count () < current_node->get_active_count ())
        np->set_active_count (current_node->get_active_count ());
    if (np->get_inactive_count () < current_node->get_inactive_count())
        np->set_inactive_count (current_node->get_inactive_count ());

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

    return prp;
}