MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / fetchHeader

Method fetchHeader

src/core/pop/MCPOPSession.cpp:473–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473MessageHeader * POPSession::fetchHeader(unsigned int index, ErrorCode * pError)
474{
475 int r;
476 char * content;
477 size_t content_len;
478
479 listIfNeeded(pError);
480 if (* pError != ErrorNone) {
481 return NULL;
482 }
483
484 r = mailpop3_top(mPop, index, 0, &content, &content_len);
485 if (r == MAILPOP3_ERROR_STREAM) {
486 * pError = ErrorConnection;
487 return NULL;
488 }
489 else if (r != MAILPOP3_NO_ERROR) {
490 * pError = ErrorFetch;
491 return NULL;
492 }
493
494 Data * data;
495 data = new Data(content, (unsigned int) content_len);
496 MessageHeader * result = new MessageHeader();
497 result->importHeadersData(data);
498 result->autorelease();
499 data->release();
500
501 mailpop3_top_free(content);
502 * pError = ErrorNone;
503
504 return result;
505}
506
507MessageHeader * POPSession::fetchHeader(POPMessageInfo * msg, ErrorCode * pError)
508{

Callers 2

mainMethod · 0.45
mainMethod · 0.45

Calls 4

releaseMethod · 0.80
importHeadersDataMethod · 0.45
autoreleaseMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected