Logo Search packages:      
Sourcecode: pan version File versions

void TaskGroups::on_nntp_done ( NNTP nntp,
Health  health,
const StringView response 
) [private, virtual]

Called at the end of an NNTP command. If the command was one that produced a list, on_nntp_line() may have been called before this.

When this is called, the listener can safely clean up anything associated with processing the command.

Parameters:
health returns OK, ERR_NETWORK, or ERR_SERVER. ERR_LOCAL is never used here.

Reimplemented from pan::NNTP::Listener.

Definition at line 131 of file task-groups.cc.

References pan::NNTP::_server, pan::Data::add_groups(), pan::ERR_NETWORK, pan::OK, pan::Task::State::set_completed(), and pan::Task::State::set_need_nntp().

{
  debug ("groups task got an on_nntp_done() from " << nntp->_server);

  if (health == ERR_NETWORK)
  {
    _state.set_need_nntp (_servername);
  }
  else // heath is OK or FAIL
  {
    if (_step == LIST_NEWSGROUPS)
    {
      int i (0);
      Data::NewGroup * ng = new Data::NewGroup [_new_groups.size()];
      foreach_const (new_groups_t, _new_groups, it)
        ng[i++] = it->second;
      _data.add_groups (_servername, ng, i);
      delete [] ng;

      debug ("groups task setting state completed");
      _state.set_completed ();
      set_finished (OK);
    }
    else // _step == LIST
    {
      _state.set_need_nntp (_servername);
      _step = LIST_NEWSGROUPS;
    }
  }

  check_in (nntp, health);
}


Generated by  Doxygen 1.6.0   Back to index