Logo Search packages:      
Sourcecode: pan version File versions  Download package

void TaskArticle::on_nntp_line ( NNTP nntp,
const StringView line 
) [private, virtual]

Invoked for each line of an NNTP server's list responses, such as a list of headers for an XOVER command or a list of lines for an ARTICLE command.

Reimplemented from pan::NNTP::Listener.

Definition at line 225 of file task-article.cc.

References pan::StringView::begin(), pan::StringView::end(), pan::StringView::len, pan::StringView::str, and pan::StringView::truncate().

{
  // FIXME: ugh, this is called for _every line_...
  Needed * needed (0);
  foreach (needed_t, _needed, it) {
    if (it->nntp == nntp) {
      needed = &*it;
      break;
    }
  }
  assert (needed);

  // some multiline headers have an extra linefeed... see bug #393589
  StringView line (line_in);
  if (line.len && line.str[line.len-1] == '\n')
    line.truncate (line.len-1);

  Needed::buf_t& buf (needed->buf);
  buf.insert (buf.end(), line.begin(), line.end());
  buf.insert (buf.end(), '\n');
  increment_step (line.len);
}


Generated by  Doxygen 1.6.0   Back to index