mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:50:11 +01:00
parser: remove isHexNumber() function
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
1e5858179e
commit
0cf7bfa04a
@ -699,8 +699,10 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
|
|||||||
|
|
||||||
len = strlen(puf);
|
len = strlen(puf);
|
||||||
|
|
||||||
if(state->is_header == 0 && strncmp(puf, "__URL__", 7) && (puf[0] == ' ' || (len > MAX_WORD_LEN && cfg->enable_cjk == 0) || isHexNumber(puf)) ) continue;
|
// skip body tokens if not an URL && (empty token || too long)
|
||||||
|
if(state->is_header == 0 && strncmp(puf, "__URL__", 7) && (puf[0] == ' ' || (len > MAX_WORD_LEN && cfg->enable_cjk == 0)) ){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(state->message_state == MSG_FROM && state->is_1st_header == 1 && strlen(state->b_from) < SMALLBUFSIZE-len-1){
|
if(state->message_state == MSG_FROM && state->is_1st_header == 1 && strlen(state->b_from) < SMALLBUFSIZE-len-1){
|
||||||
strtolower(puf);
|
strtolower(puf);
|
||||||
|
@ -15,7 +15,6 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
|
|||||||
|
|
||||||
void init_state(struct parser_state *state);
|
void init_state(struct parser_state *state);
|
||||||
time_t parse_date_header(char *s);
|
time_t parse_date_header(char *s);
|
||||||
int isHexNumber(char *p);
|
|
||||||
int extract_boundary(char *p, struct parser_state *state);
|
int extract_boundary(char *p, struct parser_state *state);
|
||||||
void fixupEncodedHeaderLine(char *buf, int buflen);
|
void fixupEncodedHeaderLine(char *buf, int buflen);
|
||||||
void fixupSoftBreakInQuotedPritableLine(char *buf, struct parser_state *state);
|
void fixupSoftBreakInQuotedPritableLine(char *buf, struct parser_state *state);
|
||||||
|
@ -261,16 +261,6 @@ time_t parse_date_header(char *datestr){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int isHexNumber(char *p){
|
|
||||||
for(; *p; p++){
|
|
||||||
if(!(*p == '-' || (*p >= 0x30 && *p <= 0x39) || (*p >= 0x41 && *p <= 0x46) || (*p >= 0x61 && *p <= 0x66)) )
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int extract_boundary(char *p, struct parser_state *state){
|
int extract_boundary(char *p, struct parser_state *state){
|
||||||
char *q, *q2;
|
char *q, *q2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user