mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-01-12 11:30:13 +01:00
Fixed date header parsing
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
535e695c2b
commit
aea0cf865d
@ -441,14 +441,14 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
|
|||||||
|
|
||||||
if(strstr(buf, "=?") && strstr(buf, "?=")) fixupEncodedHeaderLine(buf, MAXBUFSIZE);
|
if(strstr(buf, "=?") && strstr(buf, "?=")) fixupEncodedHeaderLine(buf, MAXBUFSIZE);
|
||||||
|
|
||||||
sdata->sent = parse_date_header(buf);
|
sdata->sent = parse_date_header(buf+5);
|
||||||
|
|
||||||
/* allow +2 days drift in the parsed Date: value */
|
/* allow +2 days drift in the parsed Date: value */
|
||||||
|
|
||||||
if(sdata->sent - sdata->now > 2*86400) sdata->sent = sdata->now;
|
if(sdata->sent - sdata->now > 2*86400) sdata->sent = sdata->now;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(strncasecmp(buf, "Delivery-date:", strlen("Delivery-date:")) == 0 && sdata->delivered == 0) sdata->delivered = parse_date_header(buf);
|
else if(strncasecmp(buf, "Delivery-date:", strlen("Delivery-date:")) == 0 && sdata->delivered == 0) sdata->delivered = parse_date_header(buf+14);
|
||||||
else if(strncasecmp(buf, "Received:", strlen("Received:")) == 0){
|
else if(strncasecmp(buf, "Received:", strlen("Received:")) == 0){
|
||||||
state->message_state = MSG_RECEIVED;
|
state->message_state = MSG_RECEIVED;
|
||||||
state->received_header++;
|
state->received_header++;
|
||||||
|
@ -126,7 +126,6 @@ time_t parse_date_header(char *datestr){
|
|||||||
char *p, *q, *r, *tz, s[SMALLBUFSIZE], tzh[4], tzm[3];
|
char *p, *q, *r, *tz, s[SMALLBUFSIZE], tzh[4], tzm[3];
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
datestr += 5;
|
|
||||||
p = datestr;
|
p = datestr;
|
||||||
|
|
||||||
for(; *datestr; datestr++){
|
for(; *datestr; datestr++){
|
||||||
|
Loading…
Reference in New Issue
Block a user