decode-mime: add function to get status

This new function return the textual status of MIME parsing.
pull/1667/head
Eric Leblond 11 years ago
parent 9900558428
commit a233a982ea

@ -81,7 +81,6 @@
/* Globally hold configuration data */
static MimeDecConfig mime_dec_config = { 1, 1, 1, 0, MAX_HEADER_VALUE };
#ifdef DEBUG
/* Mime Parser String translation */
static const char *StateFlags[] = { "NONE",
"HEADER_READY",
@ -93,7 +92,6 @@ static const char *StateFlags[] = { "NONE",
"PARSE_DONE",
"PARSE_ERROR",
NULL };
#endif
/* URL executable file extensions */
static const char *UrlExeExts[] = { ".exe",
@ -2265,6 +2263,11 @@ static int ProcessMimeBody(const uint8_t *buf, uint32_t len,
return ret;
}
const char *MimeDecParseStateGetStatus(MimeDecParseState *state)
{
return StateFlags[state->state_flag];
}
/**
* \brief Processes the MIME Entity based on the input line and current state of
* the parser

@ -238,6 +238,7 @@ int MimeDecParseComplete(MimeDecParseState *state);
int MimeDecParseLine(const uint8_t *line, const uint32_t len, MimeDecParseState *state);
MimeDecEntity * MimeDecParseFullMsg(const uint8_t *buf, uint32_t blen, void *data,
int (*DataChunkProcessorFunc)(const uint8_t *chunk, uint32_t len, MimeDecParseState *state));
const char *MimeDecParseStateGetStatus(MimeDecParseState *state);
/* Test functions */
void MimeDecRegisterTests(void);

Loading…
Cancel
Save