length = ret;
- alt_buf = log_state.filenames;
+ alt_buf = filenames;
alt_size = MAX_FILE;
- alt_len = &(log_state.file_logged);
+ alt_len = &(file_logged);
log_avail = alt_size - *alt_len;
if (!alt_buf || (log_avail <= 0))
return -1;
}
- log_state.file_current = *alt_len;
+ file_current = *alt_len;
*alt_len += length;
log_flags |= MIME_FLAG_FILENAME_PRESENT;
{
Flow* ssn = (Flow*)pv; // FIXIT-M eliminate need for cast
- if (log_state.file_logged > log_state.file_current)
+ if (file_logged > file_current)
{
- file_api->set_file_name(ssn, log_state.filenames + log_state.file_current,
- log_state.file_logged -log_state.file_current);
+ file_api->set_file_name(ssn, filenames + file_current,
+ file_logged - file_current);
}
else
{
void MailLogState::get_file_name(uint8_t** buf, uint32_t* len)
{
- *buf = log_state.filenames;
- *len = log_state.file_logged;
+ *buf = filenames;
+ *len = file_logged;
}
void MailLogState::get_email_hdrs(uint8_t** buf, uint32_t* len)
{
log_depth = conf->email_hdrs_log_depth;
recipients = buf;
- rcpts_logged = 0;
senders = buf + MAX_EMAIL;
- snds_logged = 0;
- log_state.filenames = buf + (2*MAX_EMAIL);
- log_state.file_logged = 0;
- log_state.file_current = 0;
+ filenames = buf + (2*MAX_EMAIL);
emailHdrs = buf + (2*MAX_EMAIL) + MAX_FILE;
- hdrs_logged = 0;
+
}
}
+
+ rcpts_logged = 0;
+ snds_logged = 0;
+ file_logged = 0;
+ file_current = 0;
+ hdrs_logged = 0;
}
MailLogState::~MailLogState()
EMAIL_RECIPIENT
};
-struct FileLogState
-{
- uint8_t* filenames;
- uint16_t file_logged;
- uint16_t file_current;
-};
-
class MailLogState
{
public:
private:
int extract_file_name(const char** start, int length, bool* disp_cont);
- FileLogState log_state;
int log_flags = 0;
uint8_t* buf = NULL;
unsigned char* emailHdrs;
uint32_t log_depth;
uint32_t hdrs_logged;
- uint8_t* recipients;
+ uint8_t* recipients = NULL;
uint16_t rcpts_logged;
- uint8_t* senders;
+ uint8_t* senders = NULL;
uint16_t snds_logged;
+ uint8_t* filenames = NULL;
+ uint16_t file_logged;
+ uint16_t file_current;
};
struct MailLogConfig