int nntpdriver_size(mailsession * session, uint32_t indx, size_t * result) { newsnntp * nntp; struct newsnntp_xover_resp_item * item; int r; int done; nntp = session_get_nntp_session(session); done = FALSE; do { r = newsnntp_xover_single(nntp, indx, &item); switch (r) { case NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_USERNAME: r = nntpdriver_authenticate_user(session); if (r != MAIL_NO_ERROR) return r; break; case NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_PASSWORD: r = nntpdriver_authenticate_password(session); if (r != MAIL_NO_ERROR) return r; break; case NEWSNNTP_NO_ERROR: done = TRUE; break; default: return nntpdriver_nntp_error_to_mail_error(r); } } while (!done); * result = item->ovr_size; xover_resp_item_free(item); return MAIL_NO_ERROR; }
static void xover_run(struct etpan_thread_op * op) { struct xover_param * param; struct xover_result * result; int r; param = op->param; result = op->result; CHECK_NNTP(); if (param->result) { r = newsnntp_xover_single(param->nntp, param->beg, param->result); } else { r = newsnntp_xover_range(param->nntp, param->beg, param->end, param->msglist); } result->error = r; debug_print("nntp xover run - end %i\n", r); }