|
a/src/bincimapmime/mime-parsefull.cc |
|
b/src/bincimapmime/mime-parsefull.cc |
|
... |
|
... |
78 |
messagerfc822 = false;
|
78 |
messagerfc822 = false;
|
79 |
multipart = false;
|
79 |
multipart = false;
|
80 |
|
80 |
|
81 |
int bsize = 0;
|
81 |
int bsize = 0;
|
82 |
string bound;
|
82 |
string bound;
|
83 |
MimePart::parseFull(bound, bsize);
|
83 |
doParseFull(bound, bsize);
|
84 |
|
84 |
|
85 |
// eat any trailing junk to get the correct size
|
85 |
// eat any trailing junk to get the correct size
|
86 |
char c;
|
86 |
char c;
|
87 |
while (mimeSource->getChar(&c));
|
87 |
while (mimeSource->getChar(&c));
|
88 |
|
88 |
|
|
... |
|
... |
107 |
messagerfc822 = false;
|
107 |
messagerfc822 = false;
|
108 |
multipart = false;
|
108 |
multipart = false;
|
109 |
|
109 |
|
110 |
int bsize = 0;
|
110 |
int bsize = 0;
|
111 |
string bound;
|
111 |
string bound;
|
112 |
MimePart::parseFull(bound, bsize);
|
112 |
doParseFull(bound, bsize);
|
113 |
|
113 |
|
114 |
// eat any trailing junk to get the correct size
|
114 |
// eat any trailing junk to get the correct size
|
115 |
char c;
|
115 |
char c;
|
116 |
while (mimeSource->getChar(&c));
|
116 |
while (mimeSource->getChar(&c));
|
117 |
|
117 |
|
|
... |
|
... |
284 |
unsigned int bodystartoffsetcrlf = mimeSource->getOffset();
|
284 |
unsigned int bodystartoffsetcrlf = mimeSource->getOffset();
|
285 |
|
285 |
|
286 |
// parsefull returns the number of bytes that need to be removed
|
286 |
// parsefull returns the number of bytes that need to be removed
|
287 |
// from the body because of the terminating boundary string.
|
287 |
// from the body because of the terminating boundary string.
|
288 |
int bsize = 0;
|
288 |
int bsize = 0;
|
289 |
if (m.parseFull(toboundary, bsize))
|
289 |
if (m.doParseFull(toboundary, bsize))
|
290 |
*foundendofpart = true;
|
290 |
*foundendofpart = true;
|
291 |
|
291 |
|
292 |
// make sure bodylength doesn't overflow
|
292 |
// make sure bodylength doesn't overflow
|
293 |
*bodylength = mimeSource->getOffset();
|
293 |
*bodylength = mimeSource->getOffset();
|
294 |
if (*bodylength >= bodystartoffsetcrlf) {
|
294 |
if (*bodylength >= bodystartoffsetcrlf) {
|
|
... |
|
... |
466 |
MimePart m;
|
466 |
MimePart m;
|
467 |
|
467 |
|
468 |
// If parseFull returns != 0, then it encountered the multipart's
|
468 |
// If parseFull returns != 0, then it encountered the multipart's
|
469 |
// final boundary.
|
469 |
// final boundary.
|
470 |
int bsize = 0;
|
470 |
int bsize = 0;
|
471 |
if (m.parseFull(boundary, bsize)) {
|
471 |
if (m.doParseFull(boundary, bsize)) {
|
472 |
quit = true;
|
472 |
quit = true;
|
473 |
*boundarysize = bsize;
|
473 |
*boundarysize = bsize;
|
474 |
}
|
474 |
}
|
475 |
|
475 |
|
476 |
members->push_back(m);
|
476 |
members->push_back(m);
|
|
... |
|
... |
589 |
MPFDEB((stderr, "BINC: parseSimple ret: bodylength %d, boundarysize %d\n",
|
589 |
MPFDEB((stderr, "BINC: parseSimple ret: bodylength %d, boundarysize %d\n",
|
590 |
*bodylength, *boundarysize));
|
590 |
*bodylength, *boundarysize));
|
591 |
}
|
591 |
}
|
592 |
|
592 |
|
593 |
//------------------------------------------------------------------------
|
593 |
//------------------------------------------------------------------------
|
594 |
int Binc::MimePart::parseFull(const string &toboundary,
|
594 |
int Binc::MimePart::doParseFull(const string &toboundary,
|
595 |
int &boundarysize) const
|
595 |
int &boundarysize) const
|
596 |
{
|
596 |
{
|
597 |
MPFDEB((stderr, "BINC: parsefull, toboundary[%s]\n", toboundary.c_str()));
|
597 |
MPFDEB((stderr, "BINC: doParsefull, toboundary[%s]\n", toboundary.c_str()));
|
598 |
headerstartoffsetcrlf = mimeSource->getOffset();
|
598 |
headerstartoffsetcrlf = mimeSource->getOffset();
|
599 |
|
599 |
|
600 |
// Parse the header of this mime part.
|
600 |
// Parse the header of this mime part.
|
601 |
parseHeader(&h, &nlines);
|
601 |
parseHeader(&h, &nlines);
|
602 |
|
602 |
|
|
... |
|
... |
624 |
} else {
|
624 |
} else {
|
625 |
parseSinglePart(toboundary, &boundarysize, &nbodylines, &nlines,
|
625 |
parseSinglePart(toboundary, &boundarysize, &nbodylines, &nlines,
|
626 |
&eof, &foundendofpart, &bodylength);
|
626 |
&eof, &foundendofpart, &bodylength);
|
627 |
}
|
627 |
}
|
628 |
|
628 |
|
629 |
MPFDEB((stderr, "BINC: parsefull ret, toboundary[%s]\n", toboundary.c_str()));
|
629 |
MPFDEB((stderr, "BINC: doParsefull ret, toboundary[%s]\n", toboundary.c_str()));
|
630 |
return (eof || foundendofpart) ? 1 : 0;
|
630 |
return (eof || foundendofpart) ? 1 : 0;
|
631 |
}
|
631 |
}
|