mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:51:59 +01:00
boundary fix
This commit is contained in:
parent
7c507ed038
commit
a9050a9f44
@ -14,7 +14,7 @@
|
||||
|
||||
#define VERSION "0.1.24-master-branch"
|
||||
|
||||
#define BUILD 833
|
||||
#define BUILD 835
|
||||
|
||||
#define HOSTID "mailarchiver"
|
||||
|
||||
|
17
src/hash.c
17
src/hash.c
@ -131,6 +131,23 @@ struct node *findnode(struct node *xhash[], char *s){
|
||||
}
|
||||
|
||||
|
||||
int is_substr_in_hash(struct node *xhash[], char *s){
|
||||
int i;
|
||||
struct node *q;
|
||||
|
||||
for(i=0;i<MAXHASH;i++){
|
||||
q = xhash[i];
|
||||
while(q != NULL){
|
||||
if(q->str && strstr(s, q->str)) return 1;
|
||||
|
||||
q = q->r;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int hash(unsigned int key){
|
||||
return key % MAXHASH;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ void clearhash(struct node *xhash[]);
|
||||
struct node *makenewnode(struct node *xhash[], char *s);
|
||||
int addnode(struct node *xhash[], char *s);
|
||||
struct node *findnode(struct node *xhash[], char *s);
|
||||
int is_substr_in_hash(struct node *xhash[], char *s);
|
||||
inline int hash(unsigned int key);
|
||||
unsigned int DJBHash(char* str, unsigned int len);
|
||||
|
||||
|
@ -473,8 +473,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
|
||||
|
||||
/* boundary check, and reset variables */
|
||||
|
||||
if(findnode(state->boundaries, buf)) boundary_line = 1;
|
||||
|
||||
boundary_line = is_substr_in_hash(state->boundaries, buf);
|
||||
|
||||
|
||||
if(!strstr(buf, "boundary=") && !strstr(buf, "boundary =") && boundary_line == 1){
|
||||
|
Loading…
Reference in New Issue
Block a user