count the stored size

This commit is contained in:
SJ 2014-05-05 15:08:38 +02:00
parent 605104224a
commit 8c12662ddc
4 changed files with 5 additions and 3 deletions

View File

@ -196,7 +196,7 @@ struct session_data {
int direction;
int tls;
int spam_message;
int fd, hdr_len, tot_len, num_of_rcpt_to, rav;
int fd, hdr_len, tot_len, store_len, num_of_rcpt_to, rav;
int need_scan;
float __acquire, __parsed, __av, __store, __compress, __encrypt;
char bodydigest[2*DIGEST_LENGTH+1];

View File

@ -455,6 +455,7 @@ void init_session_data(struct session_data *sdata, struct __config *cfg){
sdata->hdr_len = 0;
sdata->tot_len = 0;
sdata->store_len = 0;
sdata->num_of_rcpt_to = 0;
sdata->ms_journal = 0;

View File

@ -268,7 +268,7 @@ int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg){
(sdata.__acquire+sdata.__parsed+sdata.__av+sdata.__compress+sdata.__encrypt+sdata.__store)/1000000.0,
sdata.__acquire/1000000.0, sdata.__parsed/1000000.0, sdata.__av/1000000.0, sdata.__compress/1000000.0, sdata.__encrypt/1000000.0, sdata.__store/1000000.0);
syslog(LOG_PRIORITY, "%s: from=%s, size=%d, attachments=%d, reference=%s, message-id=%s, retention=%d, %s, status=%s", sdata.ttmpfile, sdata.fromemail, sdata.tot_len, sstate.n_attachments, sstate.reference, sstate.message_id, sstate.retention, delay, status);
syslog(LOG_PRIORITY, "%s: from=%s, size=%d/%d, attachments=%d, reference=%s, message-id=%s, retention=%d, %s, status=%s", sdata.ttmpfile, sdata.fromemail, sdata.tot_len, sdata.store_len, sstate.n_attachments, sstate.reference, sstate.message_id, sstate.retention, delay, status);

View File

@ -156,8 +156,9 @@ int store_file(struct session_data *sdata, char *filename, int startpos, int len
writelen = dstlen;
}
if(n == writelen){
if(n > 0 && n == writelen){
ret = 1;
sdata->store_len += writelen;
if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: stored '%s' %d/%d bytes", sdata->ttmpfile, filename, len, writelen);
}
else {