| 518 | } |
| 519 | |
| 520 | time_t NNTPSession::fetchServerDate(ErrorCode * pError) { |
| 521 | int r; |
| 522 | struct tm time; |
| 523 | time_t result; |
| 524 | |
| 525 | loginIfNeeded(pError); |
| 526 | if (* pError != ErrorNone) { |
| 527 | return (time_t) -1; |
| 528 | } |
| 529 | |
| 530 | r = newsnntp_date(mNNTP, &time); |
| 531 | |
| 532 | if (r == NEWSNNTP_ERROR_STREAM) { |
| 533 | * pError = ErrorConnection; |
| 534 | return (time_t) -1; |
| 535 | } |
| 536 | else if (r != NEWSNNTP_NO_ERROR) { |
| 537 | * pError = ErrorServerDate; |
| 538 | return (time_t) -1; |
| 539 | } |
| 540 | |
| 541 | result = mkgmtime(&time); |
| 542 | * pError = ErrorNone; |
| 543 | |
| 544 | return result; |
| 545 | } |
| 546 | |
| 547 | IndexSet * NNTPSession::fetchAllArticles(String * groupName, ErrorCode * pError) |
| 548 | { |