internal date fix

This commit is contained in:
SJ 2015-11-02 15:14:52 +01:00
parent bb62920db8
commit 8bf89488bf
7 changed files with 11 additions and 12 deletions

View File

@ -14,7 +14,7 @@
#define VERSION "1.2.0-master"
#define BUILD 923
#define BUILD 924
#define HOSTID "mailarchiver"

View File

@ -226,8 +226,7 @@ struct session_data {
float __acquire, __parsed, __av, __store, __compress, __encrypt;
char bodydigest[2*DIGEST_LENGTH+1];
char digest[2*DIGEST_LENGTH+1];
time_t now, sent, delivered;
unsigned long retained;
time_t now, sent, delivered, retained;
char ms_journal;
char import;
int journal_envelope_length, journal_bottom_length;

View File

@ -14,7 +14,7 @@ void post_parse(struct session_data *sdata, struct _state *state, struct __confi
int parse_line(char *buf, struct _state *state, struct session_data *sdata, int take_into_pieces, char *writebuffer, int writebuffersize, char *abuffer, int abuffersize, struct __data *data, struct __config *cfg);
void init_state(struct _state *state);
unsigned long parse_date_header(char *s, struct __config *cfg);
time_t parse_date_header(char *s, struct __config *cfg);
int isHexNumber(char *p);
int extract_boundary(char *p, struct _state *state);
void fixupEncodedHeaderLine(char *buf, int buflen);

View File

@ -112,10 +112,10 @@ long get_local_timezone_offset(){
}
unsigned long parse_date_header(char *datestr, struct __config *cfg){
time_t parse_date_header(char *datestr, struct __config *cfg){
int n=0, len;
long offset=0;
unsigned long ts=0;
time_t ts=0;
char *p, *q, *r, *tz, s[SMALLBUFSIZE], tzh[4], tzm[3];
struct tm tm;

View File

@ -249,7 +249,7 @@ char *check_againt_ruleset(struct node *xhash[], struct _state *state, int size,
}
unsigned long query_retain_period(struct __data *data, struct _state *state, int size, int spam, struct __config *cfg){
time_t query_retain_period(struct __data *data, struct _state *state, int size, int spam, struct __config *cfg){
size_t nmatch=0;
struct rule *p;
struct node *q;
@ -267,7 +267,7 @@ unsigned long query_retain_period(struct __data *data, struct _state *state, int
if(p->domainlen > 2){
if(strcasestr(state->b_to_domain, p->domain) || strcasestr(state->b_from_domain, p->domain)){
state->retention = p->days;
return p->days * 86400;
return (time_t)p->days * (time_t)86400;
}
}
else {
@ -301,7 +301,7 @@ unsigned long query_retain_period(struct __data *data, struct _state *state, int
if(ismatch > 0){
state->retention = p->days;
return p->days * 86400;
return (time_t)p->days * (time_t)86400;
}
}
@ -313,7 +313,7 @@ unsigned long query_retain_period(struct __data *data, struct _state *state, int
state->retention = cfg->default_retention_days;
return cfg->default_retention_days * 86400;
return (time_t)cfg->default_retention_days * (time_t)86400;
}

View File

@ -11,7 +11,7 @@ void load_rules(struct session_data *sdata, struct __data *data, struct node *xh
int append_rule(struct node *xhash[], struct rule_cond *rule_cond, struct __data *data);
struct rule *create_rule_item(struct rule_cond *rule_cond, struct __data *data);
char *check_againt_ruleset(struct node *xhash[], struct _state *state, int size, int spam);
unsigned long query_retain_period(struct __data *data, struct _state *state, int size, int spam, struct __config *cfg);
time_t query_retain_period(struct __data *data, struct _state *state, int size, int spam, struct __config *cfg);
int get_folder_id_by_rule(struct __data *data, struct _state *state, int size, int spam, struct __config *cfg);
int check_size_rule(int message_size, int size, char *_size);
int check_spam_rule(int is_spam, int spam);

View File

@ -96,7 +96,7 @@ int main(int argc, char **argv){
printf("subject: *%s*\n", state.b_subject);
printf("body: *%s*\n", state.b_body);
printf("sent: %ld, delivered-date: %ld\n", sdata.sent, sdata.delivered);
printf("sent: %lu, delivered-date: %lu\n", sdata.sent, sdata.delivered);
make_digests(&sdata, &cfg);