27 if (allIsParsed || headerIsParsed)
30 headerIsParsed =
true;
60 memset(cqueue, 0,
sizeof(cqueue));
75 if (c ==
'\n') ++nlines;
78 for (
int i = name.length() - 1; i >= 0; --i)
88 if (name.length() == 2 && name.substr(0, 2) ==
"\r\n") {
95 if (name.length() == 1 && name[0] ==
'\r') {
108 if (c ==
'\n') ++nlines;
110 for (
int i = 0; i < 3; ++i)
111 cqueue[i] = cqueue[i + 1];
114 if (strncmp(cqueue,
"\r\n\r\n", 4) == 0) {
119 if (cqueue[2] ==
'\n') {
122 if (!isspace(cqueue[3])) {
123 if (content.length() > 2)
124 content.resize(content.length() - 2);
127 h.add(name, content);
139 if (content.length() > 2)
140 content.resize(content.length() - 2);
141 h.add(name, content);
void parseOnlyHeader(int fd) const
unsigned int headerstartoffsetcrlf
virtual int parseOnlyHeader(const std::string &toboundary) const
unsigned int bodystartoffsetcrlf
unsigned int headerlength
Declaration of miscellaneous convertion functions.
Declaration of main mime parser components.
void trim(std::string &s_in, const std::string &chars=" \t\r\n")