equal
deleted
inserted
replaced
65 |
65 |
66 /* Default line size we accept from squid, longer lines (huge URLs?) malloc. */ |
66 /* Default line size we accept from squid, longer lines (huge URLs?) malloc. */ |
67 #define LINE_BUFSIZE 2048 |
67 #define LINE_BUFSIZE 2048 |
68 /* Ceiling for how many bytes can be allocated at once for a single line. */ |
68 /* Ceiling for how many bytes can be allocated at once for a single line. */ |
69 #define LINE_MAX 256000 /* 250k */ |
69 #define LINE_MAX 256000 /* 250k */ |
70 /* Maximum DB results for a single query */ |
|
71 #define DB_RESULTS_MAX 1000 |
|
72 |
70 |
73 /* Parsed line types */ |
71 /* Parsed line types */ |
74 #define REQUEST 1 |
72 #define REQUEST 1 |
75 #define RULE 2 |
73 #define RULE 2 |
76 |
74 |
116 * members are just left NULL. |
114 * members are just left NULL. |
117 * |
115 * |
118 */ |
116 */ |
119 typedef struct parsed { |
117 typedef struct parsed { |
120 unsigned short int type; |
118 unsigned short int type; |
|
119 unsigned short int wl; |
121 char *path_re; |
120 char *path_re; |
122 char *redir; |
121 char *redir; |
123 char *scheme; |
122 char *scheme; |
124 char *host; |
123 char *host; |
125 char *tld; |
124 char *tld; |
178 parsed *parse_rule( char * ); |
177 parsed *parse_rule( char * ); |
179 void populate_parsed( parsed * ); |
178 void populate_parsed( parsed * ); |
180 void parse_tld( parsed * ); |
179 void parse_tld( parsed * ); |
181 void finish_parsed( parsed * ); |
180 void finish_parsed( parsed * ); |
182 void reset_results( parsed **, unsigned int ); |
181 void reset_results( parsed **, unsigned int ); |
183 parsed *find_matching_rule( parsed **, unsigned int, parsed * ); |
182 unsigned short int check_rule( parsed *, parsed * ); |
184 void rewrite( parsed *, parsed * ); |
183 void rewrite( parsed *, parsed * ); |
185 |
184 |
186 #endif |
185 #endif |
187 |
186 |