mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 08:10:12 +01:00
count the stored size
This commit is contained in:
parent
605104224a
commit
8c12662ddc
@ -196,7 +196,7 @@ struct session_data {
|
|||||||
int direction;
|
int direction;
|
||||||
int tls;
|
int tls;
|
||||||
int spam_message;
|
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;
|
int need_scan;
|
||||||
float __acquire, __parsed, __av, __store, __compress, __encrypt;
|
float __acquire, __parsed, __av, __store, __compress, __encrypt;
|
||||||
char bodydigest[2*DIGEST_LENGTH+1];
|
char bodydigest[2*DIGEST_LENGTH+1];
|
||||||
|
@ -455,6 +455,7 @@ void init_session_data(struct session_data *sdata, struct __config *cfg){
|
|||||||
|
|
||||||
sdata->hdr_len = 0;
|
sdata->hdr_len = 0;
|
||||||
sdata->tot_len = 0;
|
sdata->tot_len = 0;
|
||||||
|
sdata->store_len = 0;
|
||||||
sdata->num_of_rcpt_to = 0;
|
sdata->num_of_rcpt_to = 0;
|
||||||
|
|
||||||
sdata->ms_journal = 0;
|
sdata->ms_journal = 0;
|
||||||
|
@ -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+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);
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -156,8 +156,9 @@ int store_file(struct session_data *sdata, char *filename, int startpos, int len
|
|||||||
writelen = dstlen;
|
writelen = dstlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(n == writelen){
|
if(n > 0 && n == writelen){
|
||||||
ret = 1;
|
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);
|
if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: stored '%s' %d/%d bytes", sdata->ttmpfile, filename, len, writelen);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user