Browse code

New header field name parser

Jan Janak authored on 25/07/2002 12:13:42
Showing 6 changed files
... ...
@@ -93,9 +93,7 @@ INSTALL-MAN = $(INSTALL) -m 644
93 93
 # -DWAIT
94 94
 #		protection against race condiditions; turn off only for debugging;
95 95
 #       to become non-optional if stable
96
-# -DNEW_HNAME
97
-#		32-bit header name parsing; turn off for lower speed ;-) or debugging;
98
-#		to become non-optional if fast and stable
96
+#
99 97
 # -SILENT_FR
100 98
 #		if defined, when FR timer hits (in tm) cancel is sent only if forking
101 99
 #		if used; otherwise, just delete the transaction without doing anything
... ...
@@ -105,7 +103,7 @@ DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
105 105
 	 -DPKG_MALLOC \
106 106
 	 -DSHM_MEM  -DSHM_MMAP \
107 107
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
108
-	 -DWAIT -DNEW_HNAME \
108
+	 -DWAIT \
109 109
 	 -DSILENT_FR \
110 110
 	 -DNOISY_REPLIES -DVERY_NOISY_REPLIES\
111 111
 	 -DPINGTEL_TAG_HACK\
... ...
@@ -9,22 +9,31 @@
9 9
 
10 10
 
11 11
 /* Header types and flags */
12
-#define HDR_EOH              -1  /* End of header found */
13
-#define HDR_ERROR             0  /* Error while parsing */
14
-#define HDR_VIA               1  /* Via header field */
15
-#define HDR_VIA1              1  /* First Via header field */
16
-#define HDR_VIA2              2  /* only used as flag*/
17
-#define HDR_TO                4  /* To header field */
18
-#define HDR_FROM              8  /* From header field */
19
-#define HDR_CSEQ             16  /* CSeq header field */
20
-#define HDR_CALLID           32  /* Call-Id header field */
21
-#define HDR_CONTACT          64  /* Contact header field */
22
-#define HDR_MAXFORWARDS     128  /* MaxForwards header field */
23
-#define HDR_ROUTE           256  /* Route header field */
24
-#define HDR_RECORDROUTE     512  /* Record-Route header field */
25
-#define HDR_CONTENTTYPE    1024  /* Content-Type header field */
26
-#define HDR_CONTENTLENGTH  2048  /* Content-Length header field */
27
-#define HDR_OTHER         65536  /* Unknown header type */ 
12
+#define HDR_EOH                -1  /* End of header found */
13
+#define HDR_ERROR               0  /* Error while parsing */
14
+#define HDR_VIA                 1  /* Via header field */
15
+#define HDR_VIA1                1  /* First Via header field */
16
+#define HDR_VIA2                2  /* only used as flag*/
17
+#define HDR_TO                  4  /* To header field */
18
+#define HDR_FROM                8  /* From header field */
19
+#define HDR_CSEQ               16  /* CSeq header field */
20
+#define HDR_CALLID             32  /* Call-Id header field */
21
+#define HDR_CONTACT            64  /* Contact header field */
22
+#define HDR_MAXFORWARDS       128  /* MaxForwards header field */
23
+#define HDR_ROUTE             256  /* Route header field */
24
+#define HDR_RECORDROUTE       512  /* Record-Route header field */
25
+#define HDR_CONTENTTYPE      1024  /* Content-Type header field */
26
+#define HDR_CONTENTLENGTH    2048  /* Content-Length header field */
27
+#define HDR_AUTHORIZATION    4096  /* Authorization header field */
28
+#define HDR_EXPIRES          8192  /* Expires header field */
29
+#define HDR_PROXYAUTH       16384  /* Proxy-Authorization header field */
30
+#define HDR_WWWAUTH         32768  /* WWW-Authorization header field */
31
+#define HDR_SUPPORTED       65536  /* Supported header field */
32
+#define HDR_REQUIRE        131072  /* Require header field */
33
+#define HDR_PROXYREQUIRE   262144  /* Proxy-Require header field */
34
+#define HDR_UNSUPPORTED    524288  /* Unsupported header field */
35
+#define HDR_ALLOW         1048576  /* Allow header field */
36
+#define HDR_OTHER         2097152  /* Some other header field */
28 37
 
29 38
 
30 39
 /* 
... ...
@@ -17,7 +17,6 @@
17 17
 #include "../mem/mem.h"
18 18
 #include "../error.h"
19 19
 #include "../globals.h"
20
-#include "parse_hname.h"
21 20
 #include "parse_hname2.h"
22 21
 
23 22
 
... ...
@@ -26,11 +25,7 @@
26 26
 #endif
27 27
 
28 28
 
29
-#ifdef NEW_HNAME
30
-#	define parse_hname(_b,_e,_h) parse_hname2((_b),(_e),(_h))
31
-#else
32
-#	define parse_hname(_b,_e,_h) parse_hname1((_b),(_e),(_h))
33
-#endif
29
+#define parse_hname(_b,_e,_h) parse_hname2((_b),(_e),(_h))
34 30
 
35 31
 
36 32
 /* returns pointer to next header line, and fill hdr_f ;
... ...
@@ -245,6 +240,42 @@ int parse_headers(struct sip_msg* msg, int flags)
245 245
 				if (msg->content_length==0) msg->content_length = hf;
246 246
 				msg->parsed_flag|=HDR_CONTENTLENGTH;
247 247
 				break;
248
+		        case HDR_AUTHORIZATION:
249
+			        if (msg->authorization==0) msg->authorization = hf;
250
+				msg->parsed_flag|=HDR_AUTHORIZATION;
251
+				break;
252
+        		case HDR_EXPIRES:
253
+				if (msg->expires==0) msg->expires = hf;
254
+				msg->parsed_flag|=HDR_EXPIRES;
255
+				break;
256
+		        case HDR_PROXYAUTH:
257
+				if (msg->proxy_auth==0) msg->proxy_auth = hf;
258
+				msg->parsed_flag|=HDR_PROXYAUTH;
259
+				break;
260
+		        case HDR_WWWAUTH:
261
+				if (msg->www_auth==0) msg->www_auth = hf;
262
+				msg->parsed_flag|=HDR_WWWAUTH;
263
+				break;
264
+		        case HDR_SUPPORTED:
265
+				if (msg->supported==0) msg->supported = hf;
266
+				msg->parsed_flag|=HDR_SUPPORTED;
267
+				break;
268
+		        case HDR_REQUIRE:
269
+				if (msg->require==0) msg->require = hf;
270
+				msg->parsed_flag|=HDR_REQUIRE;
271
+				break;
272
+		        case HDR_PROXYREQUIRE:
273
+				if (msg->proxy_require==0) msg->proxy_require = hf;
274
+				msg->parsed_flag|=HDR_PROXYREQUIRE;
275
+				break;
276
+		        case HDR_UNSUPPORTED:
277
+				if (msg->unsupported==0) msg->unsupported=hf;
278
+				msg->parsed_flag|=HDR_UNSUPPORTED;
279
+				break;
280
+		        case HDR_ALLOW:
281
+				if (msg->allow==0) msg->allow = hf;
282
+				msg->parsed_flag|=HDR_ALLOW;
283
+				break;
248 284
 			case HDR_VIA:
249 285
 				msg->parsed_flag|=HDR_VIA;
250 286
 				DBG("parse_headers: Via found, flags=%d\n", flags);
... ...
@@ -69,6 +69,15 @@ struct sip_msg {
69 69
 	struct hdr_field* record_route;
70 70
 	struct hdr_field* content_type;
71 71
 	struct hdr_field* content_length;
72
+	struct hdr_field* authorization;
73
+	struct hdr_field* expires;
74
+	struct hdr_field* proxy_auth;
75
+	struct hdr_field* www_auth;
76
+	struct hdr_field* supported;
77
+	struct hdr_field* require;
78
+	struct hdr_field* proxy_require;
79
+	struct hdr_field* unsupported;
80
+	struct hdr_field* allow;
72 81
 
73 82
 	char* eoh;        /* pointer to the end of header (if found) or null */
74 83
 	char* unparsed;   /* here we stopped parsing*/
... ...
@@ -2,18 +2,9 @@
2 2
  * $Id$
3 3
  */
4 4
 
5
-/* 
6
- * TODO: Optimize short variants of headers
7
- *       Test, Test, Test....
8
- *       Hardwire into ser core
9
- */
10 5
 
11
-#include <stdio.h>
12
-#include <stdlib.h>
13
-#include <string.h>
14
-#include "msg_parser.h"
15
-#include "strs.h"
16
-#include "../dprint.h"
6
+#include "parse_hname2.h"
7
+#include "keys.h"
17 8
 #include "../ut.h"  /* q_memchr */
18 9
 
19 10
 /*
... ...
@@ -24,7 +15,8 @@
24 24
  * WARNING ! This value MUST be recalculated if you want
25 25
  * a new header to be recognized
26 26
  */
27
-#define HASH_TABLE_SIZE 1471
27
+#define HASH_TABLE_SIZE 9349
28
+
28 29
 
29 30
 /*
30 31
  * Hash function
... ...
@@ -46,7 +38,9 @@ struct ht_entry {
46 46
 	unsigned int value;
47 47
 };
48 48
 
49
-static struct ht_entry hash_table[ HASH_TABLE_SIZE ];
49
+
50
+static struct ht_entry hash_table[HASH_TABLE_SIZE];
51
+
50 52
 
51 53
 /*
52 54
  * Pointer to the hash table
... ...
@@ -107,278 +101,68 @@ static inline int unify(int key)
107 107
 }
108 108
 
109 109
 
110
-#define Via1_CASE         \
111
-     hdr->type = HDR_VIA; \
112
-     hdr->name.len = 3;   \
113
-     *(p + 3) = '\0';     \
114
-     return p + 4        
115
-
116
-
117
-#define From_CASE          \
118
-     hdr->type = HDR_FROM; \
119
-     p += 4;               \
120
-     goto dc_end
121
-
122
-
123
-#define To12_CASE        \
124
-     hdr->type = HDR_TO; \
125
-     hdr->name.len = 2;  \
126
-     *(p + 2) = '\0';    \
127
-     return (p + 3)
128
-
129
-
130
-#define CSeq_CASE          \
131
-     hdr->type = HDR_CSEQ; \
132
-     p += 4;               \
133
-     goto dc_end
134
-
135
-
136
-#define Call_CASE                      \
137
-     p += 4;                           \
138
-     val = READ(p);                    \
139
-     switch(val) {                     \
140
-     case _ID1:                        \
141
-	     hdr->type = HDR_CALLID;   \
142
-	     hdr->name.len = 7;        \
143
-	     *(p + 3) = '\0';          \
144
-	     return (p + 4);           \
145
-	                               \
146
-     case _ID2:                        \
147
-	     hdr->type = HDR_CALLID;   \
148
-	     p += 4;                   \
149
-	     goto dc_end;              \
150
-     }                                 \
151
-                                       \
152
-     val = unify(val);                 \
153
-     switch(val) {                     \
154
-     case _ID1:                        \
155
-	     hdr->type = HDR_CALLID;   \
156
-	     hdr->name.len = 7;        \
157
-	     *(p + 3) = '\0';          \
158
-	     return (p + 4);           \
159
-	                               \
160
-     case _ID2:                        \
161
-	     hdr->type = HDR_CALLID;   \
162
-	     p += 4;                   \
163
-	     goto dc_end;              \
164
-                                       \
165
-     default: goto other;              \
166
-     }                                 \
167
-     break
168
-
169
-
170
-/* added by Bogdan - for Content-Type and -Length headers */
171
-#define Ent__CASE \
172
-	p += 4;\
173
-	val = READ(p);\
174
-	switch(val) {\
175
-	case xType:\
176
-		hdr->type = HDR_CONTENTTYPE;\
177
-		p += 4;\
178
-		goto dc_end;\
179
-	case Leng:\
180
-		p += 4;\
181
-		val = READ(p);\
182
-		if (val==th12){\
183
-			hdr->type = HDR_CONTENTLENGTH;\
184
-			hdr->name.len = 14;\
185
-			*(p + 2) = '\0';\
186
-			return (p + 3);\
187
-		}\
188
-		val = unify(val);\
189
-		if (val==th12){\
190
-			hdr->type = HDR_CONTENTLENGTH;\
191
-			hdr->name.len = 14;\
192
-			*(p + 2) = '\0';\
193
-			return (p + 3);\
194
-		}else\
195
-			goto other;\
196
-	}\
197
-	val = unify(val);\
198
-	switch(val) {\
199
-	case xType:\
200
-		hdr->type = HDR_CONTENTTYPE;\
201
-		p += 4;\
202
-		goto dc_end;\
203
-	case Leng:\
204
-		p += 4;\
205
-		val = READ(p);\
206
-		if (val==th12){\
207
-			hdr->type = HDR_CONTENTLENGTH;\
208
-			hdr->name.len = 14;\
209
-			*(p + 2) = '\0';\
210
-			return (p + 3);\
211
-		}\
212
-		val = unify(val);\
213
-		if (val==th12){\
214
-			hdr->type = HDR_CONTENTLENGTH;\
215
-			hdr->name.len = 14;\
216
-			*(p + 2) = '\0';\
217
-			return (p + 3);\
218
-		}else\
219
-			goto other;\
220
-	default:\
221
-		goto other;\
222
-	}\
223
-	break
224
-
225
-
226
-#define Cont_CASE                     \
227
-     p += 4;                          \
228
-     val = READ(p);                   \
229
-     switch(val) {                    \
230
-     case act1:                       \
231
-	     hdr->type = HDR_CONTACT; \
232
-	     hdr->name.len = 7;       \
233
-	     *(p + 3) = '\0';         \
234
-	     return (p + 4);          \
235
-	                              \
236
-     case act2:                       \
237
-	     hdr->type = HDR_CONTACT; \
238
-	     p += 4;                  \
239
-	     goto dc_end;             \
240
-	                              \
241
-     case ent_:                   \
242
-	     Ent__CASE;               \
243
-     }                                \
244
-                                      \
245
-     val = unify(val);                \
246
-     switch(val) {                    \
247
-     case act1:                       \
248
-	     hdr->type = HDR_CONTACT; \
249
-	     hdr->name.len = 7;       \
250
-	     *(p + 3) = '\0';         \
251
-	     return (p + 4);          \
252
-	                              \
253
-     case act2:                       \
254
-	     hdr->type = HDR_CONTACT; \
255
-	     p += 4;                  \
256
-	     goto dc_end;             \
257
-                                      \
258
-     case ent_:                   \
259
-	     Ent__CASE;               \
260
-	                                  \
261
-     default: goto other;             \
262
-     }                                \
263
-     break
264
-
265
-
266
-#define Rout_CASE                   \
267
-     p += 4;                        \
268
-     switch(*p) {                   \
269
-     case 'e':                      \
270
-     case 'E':                      \
271
-	     hdr->type = HDR_ROUTE; \
272
-	     p++;                   \
273
-	     goto dc_end;           \
274
-                                    \
275
-     default:                       \
276
-	     goto other;            \
277
-     }                              \
278
-     break
279
-
280
-
281
-#define Max_CASE                                   \
282
-     p += 4;                                       \
283
-     val = READ(p);                                \
284
-     switch(val) {                                 \
285
-     case Forw:                                    \
286
-	     p += 4;                               \
287
-	     val = READ(p);                        \
288
-	     if (val == ards) {                    \
289
-		     hdr->type = HDR_MAXFORWARDS;  \
290
-		     p += 4;                       \
291
-		     goto dc_end;                  \
292
-	     }                                     \
293
-                                                   \
294
-	     val = unify(val);                     \
295
-	     if (val == ards) {                    \
296
-		     hdr->type = HDR_MAXFORWARDS;  \
297
-		     p += 4;                       \
298
-		     goto dc_end;                  \
299
-	     }                                     \
300
-	     goto other;                           \
301
-     }                                             \
302
-                                                   \
303
-     val = unify(val);                             \
304
-     switch(val) {                                 \
305
-     case Forw:                                    \
306
-	     p += 4;                               \
307
-	     val = READ(p);                        \
308
-	     if (val == ards) {                    \
309
-		     hdr->type = HDR_MAXFORWARDS;  \
310
-		     p += 4;                       \
311
-		     goto dc_end;                  \
312
-	     }                                     \
313
-                                                   \
314
-	     val = unify(val);                     \
315
-	     if (val == ards) {                    \
316
-		     hdr->type = HDR_MAXFORWARDS;  \
317
-		     p += 4;                       \
318
-		     goto dc_end;                  \
319
-	     }                                     \
320
-     default: goto other;                          \
321
-     }                                             \
322
-                                                   \
323
-     break
324
-
325
-
326
-#define Reco_CASE                                 \
327
-     p += 4;                                      \
328
-     val = READ(p);                               \
329
-     switch(val) {                                \
330
-     case rd_R:                                   \
331
-	     p += 4;                              \
332
-	     val = READ(p);                       \
333
-	     if (val == oute) {                   \
334
-		     hdr->type = HDR_RECORDROUTE; \
335
-		     p += 4;                      \
336
-		     goto dc_end;                 \
337
-	     }                                    \
338
-                                                  \
339
-	     val = unify(val);                    \
340
-	     if (val == oute) {                   \
341
-		     hdr->type = HDR_RECORDROUTE; \
342
-		     p += 4;                      \
343
-		     goto dc_end;                 \
344
-	     }                                    \
345
-	     goto other;                          \
346
-     }                                            \
347
-                                                  \
348
-     val = unify(val);                            \
349
-     switch(val) {                                \
350
-     case rd_R:                                   \
351
-	     p += 4;                              \
352
-	     val = READ(p);                       \
353
-	     if (val == oute) {                   \
354
-		     hdr->type = HDR_RECORDROUTE; \
355
-		     p += 4;                      \
356
-		     goto dc_end;                 \
357
-	     }                                    \
358
-                                                  \
359
-	     val = unify(val);                    \
360
-	     if (val == oute) {                   \
361
-		     hdr->type = HDR_RECORDROUTE; \
362
-		     p += 4;                      \
363
-		     goto dc_end;                 \
364
-	     }                                    \
365
-     default: goto other;                         \
366
-     }                                            \
367
-     break
368
-
369
-
370
-#define Via2_CASE         \
371
-     hdr->type = HDR_VIA; \
372
-     p += 4;              \
373
-     goto dc_end
110
+/*
111
+ * Parser macros
112
+ */
113
+#include "case_via.h"      /* Via */
114
+#include "case_from.h"     /* From */
115
+#include "case_to.h"       /* To */
116
+#include "case_cseq.h"     /* CSeq */
117
+#include "case_call.h"     /* Call-ID */
118
+#include "case_cont.h"     /* Contact, Content-Type, Content-Length */
119
+#include "case_rout.h"     /* Route */
120
+#include "case_max.h"      /* Max-Forwards */
121
+#include "case_reco.h"     /* Record-Route */
122
+#include "case_auth.h"     /* Authorization */
123
+#include "case_expi.h"     /* Expires */
124
+#include "case_prox.h"     /* Proxy-Authorization, Proxy-Require */
125
+#include "case_allo.h"     /* Allow */
126
+#include "case_unsu.h"     /* Unsupported */
127
+#include "case_requ.h"     /* Require */
128
+#include "case_supp.h"     /* Supported */
129
+#include "case_www.h"      /* WWW-Authenticate */
374 130
 
375 131
 
376 132
 #define READ(val) \
377 133
 (*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
378 134
 
379
-/*
380
- * Yet another parse_hname - Ultra Fast version :-)
381
- */
135
+
136
+#define FIRST_QUATERNIONS       \
137
+        case _Via1_: Via1_CASE; \
138
+	case _From_: From_CASE; \
139
+	case _To12_: To12_CASE; \
140
+	case _CSeq_: CSeq_CASE; \
141
+	case _Call_: Call_CASE; \
142
+	case _Cont_: Cont_CASE; \
143
+	case _Rout_: Rout_CASE; \
144
+	case _Max__: Max_CASE;  \
145
+	case _Reco_: Reco_CASE; \
146
+	case _Via2_: Via2_CASE; \
147
+	case _Auth_: Auth_CASE; \
148
+	case _Expi_: Expi_CASE; \
149
+	case _Prox_: Prox_CASE; \
150
+	case _Allo_: Allo_CASE; \
151
+	case _Unsu_: Unsu_CASE; \
152
+	case _Requ_: Requ_CASE; \
153
+	case _Supp_: Supp_CASE; \
154
+        case _WWW__: WWW_CASE;
155
+
156
+
157
+#define PARSE_COMPACT(id)          \
158
+        switch(*(p + 1)) {         \
159
+        case ' ':                  \
160
+	        hdr->type = id;    \
161
+	        p += 2;            \
162
+	        goto dc_end;       \
163
+	                           \
164
+        case ':':                  \
165
+	        hdr->type = id;    \
166
+	        hdr->name.len = 1; \
167
+	        *(p + 1) = '\0';   \
168
+	        return (p + 2);    \
169
+        }                            
170
+
171
+
382 172
 char* parse_hname2(char* begin, char* end, struct hdr_field* hdr)
383 173
 {
384 174
 	register char* p;
... ...
@@ -394,145 +178,67 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr)
394 394
 	}
395 395
 
396 396
 	switch(val) {
397
-	case Via1: Via1_CASE;
398
-	case From: From_CASE;
399
-	case To12: To12_CASE;
400
-	case CSeq: CSeq_CASE;
401
-	case Call: Call_CASE;
402
-	case Cont: Cont_CASE;
403
-	case Rout: Rout_CASE;
404
-	case Max_: Max_CASE;
405
-	case Reco: Reco_CASE;
406
-	case Via2: Via2_CASE;
397
+	FIRST_QUATERNIONS;
407 398
 
408 399
 	default:
409 400
 		switch(*p) {
410
-		case 'T':
411
-		case 't':
412
-			switch(*(p + 1)) {
413
-			case 'o':
414
-			case 'O':
415
-			case ' ':   /* Short form */
416
-				hdr->type = HDR_TO;
417
-				p += 2;
418
-				goto dc_end;
419
-
420
-			case ':':
421
-				hdr->type = HDR_TO;
422
-				hdr->name.len = 1;
423
-				*(p + 1) = '\0';
424
-				return (p + 2);
425
-			}
426
-
427
-		case 'V':
428
-		case 'v':
429
-			switch(*(p + 1)) {
430
-			case ' ':
431
-				hdr->type = HDR_VIA;
432
-				p += 2;
433
-				goto dc_end;
401
+		case 'T':                           
402
+		case 't':                           
403
+			switch(*(p + 1)) {          
404
+			case 'o':                   
405
+			case 'O':                   
406
+			case ' ':                   
407
+				hdr->type = HDR_TO; 
408
+				p += 2;             
409
+				goto dc_end;        
434 410
 				
435
-			case ':':
436
-				hdr->type = HDR_VIA;
437
-				hdr->name.len = 1;
438
-				*(p + 1) = '\0';
439
-				return (p + 2);
440
-			}
411
+			case ':':                   
412
+				hdr->type = HDR_TO; 
413
+				hdr->name.len = 1;  
414
+				*(p + 1) = '\0'; 
415
+				return (p + 2);     
416
+			}                           
441 417
 			break;
442 418
 
419
+		case 'V':                            
420
+		case 'v':                            
421
+			PARSE_COMPACT(HDR_VIA);
422
+			break;
423
+			
443 424
 		case 'F':
444 425
 		case 'f':
445
-			switch(*(p + 1)) {
446
-			case ' ':
447
-				hdr->type = HDR_FROM;
448
-				p += 2;
449
-				goto dc_end;
450
-				
451
-			case ':':
452
-				hdr->type = HDR_FROM;
453
-				hdr->name.len = 1;
454
-				*(p + 1)= '\0';
455
-				return (p + 2);
456
-			}
426
+			PARSE_COMPACT(HDR_FROM);
457 427
 			break;
458
-
428
+			
459 429
 		case 'I':
460 430
 		case 'i':
461
-			switch(*(p + 1)) {
462
-			case ' ':
463
-				hdr->type = HDR_CALLID;
464
-				p += 2;
465
-				goto dc_end;
466
-				
467
-			case ':':
468
-				hdr->type = HDR_CALLID;
469
-				hdr->name.len = 1;
470
-				*(p + 1) = '\0';
471
-				return (p + 2);
472
-			}
431
+			PARSE_COMPACT(HDR_CALLID);
473 432
 			break;
474 433
 
475 434
 		case 'M':
476 435
 		case 'm':
477
-			switch(*(p + 1)) {
478
-			case ' ':
479
-				hdr->type = HDR_CONTACT;
480
-				p += 2;
481
-				goto dc_end;
482
-				
483
-			case ':':
484
-				hdr->type = HDR_CONTACT;
485
-				hdr->name.len = 1;
486
-				*(p + 1) = '\0';
487
-				return (p + 2);
488
-			}
436
+			PARSE_COMPACT(HDR_CONTACT);
489 437
 			break;
490 438
 
491
-        case 'C':
492
-		case 'c':
493
-			switch(*(p + 1)) {
494
-			case ' ':
495
-				hdr->type = HDR_CONTENTTYPE;
496
-				p += 2;
497
-				goto dc_end;
498
-				
499
-			case ':':
500
-				hdr->type = HDR_CONTENTTYPE;
501
-				hdr->name.len = 1;
502
-				*(p + 1) = '\0';
503
-				return (p + 2);
504
-			}
439
+		case 'L':
440
+		case 'l':
441
+			PARSE_COMPACT(HDR_CONTENTLENGTH);
505 442
 			break;
506 443
 
507
-        case 'L':
508
-		case 'l':
509
-			switch(*(p + 1)) {
510
-			case ' ':
511
-				hdr->type = HDR_CONTENTLENGTH;
512
-				p += 2;
513
-				goto dc_end;
514
-				
515
-			case ':':
516
-				hdr->type = HDR_CONTENTLENGTH;
517
-				hdr->name.len = 1;
518
-				*(p + 1) = '\0';
519
-				return (p + 2);
520
-			}
444
+		case 'C':
445
+		case 'c':
446
+			PARSE_COMPACT(HDR_CONTENTTYPE);
521 447
 			break;
448
+
449
+		case 'K':
450
+		case 'k':
451
+			PARSE_COMPACT(HDR_SUPPORTED);
452
+                        break;
522 453
 		}
523 454
 		
524 455
 		val = unify(val);
525 456
 		switch(val) {
526
-		case Via1: Via1_CASE;
527
-		case From: From_CASE;
528
-		case To12: To12_CASE;
529
-		case CSeq: CSeq_CASE;
530
-		case Call: Call_CASE;
531
-		case Cont: Cont_CASE;
532
-		case Rout: Rout_CASE;
533
-		case Max_: Max_CASE;
534
-		case Reco: Reco_CASE;
535
-		case Via2: Via2_CASE;
457
+		FIRST_QUATERNIONS;
536 458
 		default: goto other;
537 459
 		}
538 460
         }
... ...
@@ -553,9 +259,9 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr)
553 553
 	p = q_memchr(p, ':', end - p);
554 554
 	if (!p) {        /* No double colon found, error.. */
555 555
 		hdr->type = HDR_ERROR;
556
-		hdr->name.s = NULL;
556
+		hdr->name.s = 0;
557 557
 		hdr->name.len = 0;
558
-		return NULL;
558
+		return 0;
559 559
 	} else {
560 560
 		hdr->type = HDR_OTHER;
561 561
 		*p = '\0';
... ...
@@ -565,247 +271,130 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr)
565 565
 }
566 566
 
567 567
 
568
+/* Number of distinct keys */
569
+#define NUM_KEYS  592
570
+
571
+/* Number of distinct values */
572
+#define NUM_VALS 49
573
+
574
+
575
+/*
576
+ * Create synonym-less (precalculated) hash table
577
+ */
568 578
 void init_htable(void)
569 579
 {
570
-	int i;
571
-
572
-	     /*
573
-	      * Create hash table array
574
-	      */
575
-	
576
-	     /*
577
-	      * Mark all elements as empty
578
-	      */
580
+	int i, j, k;
581
+
582
+	     /* Hash table values */
583
+	unsigned int init_val[NUM_VALS] = {
584
+		_Allo_, _Auth_, _oriz_, _atio_, _Call_, __ID2_, __ID1_, _Cont_,
585
+		_act2_, _act1_, _ent__, _Leng_, _th12_, _Type_, _CSeq_, _Expi_,
586
+		_res2_, _res1_, _From_, _Max__, _Forw_, _ards_, _Prox_, _y_Au_,
587
+		_thor_, _izat_, _ion2_, _ion1_, _y_Re_, _quir_, _Reco_, _rd_R_,
588
+		_oute_, _Requ_, _ire2_, _ire1_, _Rout_, _Supp_, _orte_, _To12_,
589
+		_Unsu_, _ppor_, _ted2_, _ted1_, _Via2_, _Via1_, _WWW__, _enti_,
590
+		_cate_
591
+	};
592
+
593
+	     /* Number of keys associated to each value */
594
+	unsigned int key_nums[NUM_VALS] = {
595
+		16, 16, 16, 16, 16,  4,  4, 16, 
596
+		 8,  8,  8, 16,  4, 16, 16, 16, 
597
+		 8,  8, 16,  8, 16, 16, 16,  8, 
598
+		16, 16,  8,  8,  8, 16, 16,  8, 
599
+		16, 16,  8,  8, 16, 16, 16,  4, 
600
+		16, 16,  8,  8,  8,  8,  8, 16,
601
+                16
602
+	};
603
+
604
+	     /* Hash table keys */
605
+	unsigned int init_key[NUM_KEYS] = {
606
+		_allo_, _allO_, _alLo_, _alLO_, _aLlo_, _aLlO_, _aLLo_, _aLLO_, 
607
+		_Allo_, _AllO_, _AlLo_, _AlLO_, _ALlo_, _ALlO_, _ALLo_, _ALLO_, 
608
+		_auth_, _autH_, _auTh_, _auTH_, _aUth_, _aUtH_, _aUTh_, _aUTH_, 
609
+		_Auth_, _AutH_, _AuTh_, _AuTH_, _AUth_, _AUtH_, _AUTh_, _AUTH_, 
610
+		_oriz_, _oriZ_, _orIz_, _orIZ_, _oRiz_, _oRiZ_, _oRIz_, _oRIZ_, 
611
+		_Oriz_, _OriZ_, _OrIz_, _OrIZ_, _ORiz_, _ORiZ_, _ORIz_, _ORIZ_, 
612
+		_atio_, _atiO_, _atIo_, _atIO_, _aTio_, _aTiO_, _aTIo_, _aTIO_, 
613
+		_Atio_, _AtiO_, _AtIo_, _AtIO_, _ATio_, _ATiO_, _ATIo_, _ATIO_, 
614
+		_call_, _calL_, _caLl_, _caLL_, _cAll_, _cAlL_, _cALl_, _cALL_, 
615
+		_Call_, _CalL_, _CaLl_, _CaLL_, _CAll_, _CAlL_, _CALl_, _CALL_, 
616
+		__id2_, __iD2_, __Id2_, __ID2_, __id1_, __iD1_, __Id1_, __ID1_, 
617
+		_cont_, _conT_, _coNt_, _coNT_, _cOnt_, _cOnT_, _cONt_, _cONT_, 
618
+		_Cont_, _ConT_, _CoNt_, _CoNT_, _COnt_, _COnT_, _CONt_, _CONT_, 
619
+		_act2_, _acT2_, _aCt2_, _aCT2_, _Act2_, _AcT2_, _ACt2_, _ACT2_, 
620
+		_act1_, _acT1_, _aCt1_, _aCT1_, _Act1_, _AcT1_, _ACt1_, _ACT1_, 
621
+		_ent__, _enT__, _eNt__, _eNT__, _Ent__, _EnT__, _ENt__, _ENT__, 
622
+		_leng_, _lenG_, _leNg_, _leNG_, _lEng_, _lEnG_, _lENg_, _lENG_, 
623
+		_Leng_, _LenG_, _LeNg_, _LeNG_, _LEng_, _LEnG_, _LENg_, _LENG_, 
624
+		_th12_, _tH12_, _Th12_, _TH12_, _type_, _typE_, _tyPe_, _tyPE_, 
625
+		_tYpe_, _tYpE_, _tYPe_, _tYPE_, _Type_, _TypE_, _TyPe_, _TyPE_, 
626
+		_TYpe_, _TYpE_, _TYPe_, _TYPE_, _cseq_, _cseQ_, _csEq_, _csEQ_, 
627
+		_cSeq_, _cSeQ_, _cSEq_, _cSEQ_, _Cseq_, _CseQ_, _CsEq_, _CsEQ_, 
628
+		_CSeq_, _CSeQ_, _CSEq_, _CSEQ_, _expi_, _expI_, _exPi_, _exPI_, 
629
+		_eXpi_, _eXpI_, _eXPi_, _eXPI_, _Expi_, _ExpI_, _ExPi_, _ExPI_, 
630
+		_EXpi_, _EXpI_, _EXPi_, _EXPI_, _res2_, _reS2_, _rEs2_, _rES2_, 
631
+		_Res2_, _ReS2_, _REs2_, _RES2_, _res1_, _reS1_, _rEs1_, _rES1_, 
632
+		_Res1_, _ReS1_, _REs1_, _RES1_, _from_, _froM_, _frOm_, _frOM_, 
633
+		_fRom_, _fRoM_, _fROm_, _fROM_, _From_, _FroM_, _FrOm_, _FrOM_, 
634
+		_FRom_, _FRoM_, _FROm_, _FROM_, _max__, _maX__, _mAx__, _mAX__, 
635
+		_Max__, _MaX__, _MAx__, _MAX__, _forw_, _forW_, _foRw_, _foRW_, 
636
+		_fOrw_, _fOrW_, _fORw_, _fORW_, _Forw_, _ForW_, _FoRw_, _FoRW_, 
637
+		_FOrw_, _FOrW_, _FORw_, _FORW_, _ards_, _ardS_, _arDs_, _arDS_, 
638
+		_aRds_, _aRdS_, _aRDs_, _aRDS_, _Ards_, _ArdS_, _ArDs_, _ArDS_, 
639
+		_ARds_, _ARdS_, _ARDs_, _ARDS_, _prox_, _proX_, _prOx_, _prOX_, 
640
+		_pRox_, _pRoX_, _pROx_, _pROX_, _Prox_, _ProX_, _PrOx_, _PrOX_, 
641
+		_PRox_, _PRoX_, _PROx_, _PROX_, _y_au_, _y_aU_, _y_Au_, _y_AU_, 
642
+		_Y_au_, _Y_aU_, _Y_Au_, _Y_AU_, _thor_, _thoR_, _thOr_, _thOR_, 
643
+		_tHor_, _tHoR_, _tHOr_, _tHOR_, _Thor_, _ThoR_, _ThOr_, _ThOR_, 
644
+		_THor_, _THoR_, _THOr_, _THOR_, _izat_, _izaT_, _izAt_, _izAT_, 
645
+		_iZat_, _iZaT_, _iZAt_, _iZAT_, _Izat_, _IzaT_, _IzAt_, _IzAT_, 
646
+		_IZat_, _IZaT_, _IZAt_, _IZAT_, _ion2_, _ioN2_, _iOn2_, _iON2_, 
647
+		_Ion2_, _IoN2_, _IOn2_, _ION2_, _ion1_, _ioN1_, _iOn1_, _iON1_, 
648
+		_Ion1_, _IoN1_, _IOn1_, _ION1_, _y_re_, _y_rE_, _y_Re_, _y_RE_, 
649
+		_Y_re_, _Y_rE_, _Y_Re_, _Y_RE_, _quir_, _quiR_, _quIr_, _quIR_, 
650
+		_qUir_, _qUiR_, _qUIr_, _qUIR_, _Quir_, _QuiR_, _QuIr_, _QuIR_, 
651
+		_QUir_, _QUiR_, _QUIr_, _QUIR_, _reco_, _recO_, _reCo_, _reCO_, 
652
+		_rEco_, _rEcO_, _rECo_, _rECO_, _Reco_, _RecO_, _ReCo_, _ReCO_, 
653
+		_REco_, _REcO_, _RECo_, _RECO_, _rd_r_, _rd_R_, _rD_r_, _rD_R_, 
654
+		_Rd_r_, _Rd_R_, _RD_r_, _RD_R_, _oute_, _outE_, _ouTe_, _ouTE_, 
655
+		_oUte_, _oUtE_, _oUTe_, _oUTE_, _Oute_, _OutE_, _OuTe_, _OuTE_, 
656
+		_OUte_, _OUtE_, _OUTe_, _OUTE_, _requ_, _reqU_, _reQu_, _reQU_, 
657
+		_rEqu_, _rEqU_, _rEQu_, _rEQU_, _Requ_, _ReqU_, _ReQu_, _ReQU_, 
658
+		_REqu_, _REqU_, _REQu_, _REQU_, _ire2_, _irE2_, _iRe2_, _iRE2_, 
659
+		_Ire2_, _IrE2_, _IRe2_, _IRE2_, _ire1_, _irE1_, _iRe1_, _iRE1_, 
660
+		_Ire1_, _IrE1_, _IRe1_, _IRE1_, _rout_, _rouT_, _roUt_, _roUT_, 
661
+		_rOut_, _rOuT_, _rOUt_, _rOUT_, _Rout_, _RouT_, _RoUt_, _RoUT_, 
662
+		_ROut_, _ROuT_, _ROUt_, _ROUT_, _supp_, _supP_, _suPp_, _suPP_, 
663
+		_sUpp_, _sUpP_, _sUPp_, _sUPP_, _Supp_, _SupP_, _SuPp_, _SuPP_, 
664
+		_SUpp_, _SUpP_, _SUPp_, _SUPP_, _orte_, _ortE_, _orTe_, _orTE_, 
665
+		_oRte_, _oRtE_, _oRTe_, _oRTE_, _Orte_, _OrtE_, _OrTe_, _OrTE_, 
666
+		_ORte_, _ORtE_, _ORTe_, _ORTE_, _to12_, _tO12_, _To12_, _TO12_, 
667
+		_unsu_, _unsU_, _unSu_, _unSU_, _uNsu_, _uNsU_, _uNSu_, _uNSU_, 
668
+		_Unsu_, _UnsU_, _UnSu_, _UnSU_, _UNsu_, _UNsU_, _UNSu_, _UNSU_, 
669
+		_ppor_, _ppoR_, _ppOr_, _ppOR_, _pPor_, _pPoR_, _pPOr_, _pPOR_, 
670
+		_Ppor_, _PpoR_, _PpOr_, _PpOR_, _PPor_, _PPoR_, _PPOr_, _PPOR_, 
671
+		_ted2_, _teD2_, _tEd2_, _tED2_, _Ted2_, _TeD2_, _TEd2_, _TED2_, 
672
+		_ted1_, _teD1_, _tEd1_, _tED1_, _Ted1_, _TeD1_, _TEd1_, _TED1_, 
673
+		_via2_, _viA2_, _vIa2_, _vIA2_, _Via2_, _ViA2_, _VIa2_, _VIA2_, 
674
+		_via1_, _viA1_, _vIa1_, _vIA1_, _Via1_, _ViA1_, _VIa1_, _VIA1_, 
675
+		_www__, _wwW__, _wWw__, _wWW__, _Www__, _WwW__, _WWw__, _WWW__, 
676
+		_enti_, _entI_, _enTi_, _enTI_, _eNti_, _eNtI_, _eNTi_, _eNTI_, 
677
+		_Enti_, _EntI_, _EnTi_, _EnTI_, _ENti_, _ENtI_, _ENTi_, _ENTI_, 
678
+		_cate_, _catE_, _caTe_, _caTE_, _cAte_, _cAtE_, _cATe_, _cATE_, 
679
+		_Cate_, _CatE_, _CaTe_, _CaTE_, _CAte_, _CAtE_, _CATe_, _CATE_
680
+	}; 
681
+
682
+	     /* Mark all elements as empty */
579 683
 	for(i = 0; i < HASH_TABLE_SIZE; i++) {
580 684
 		set_entry(HASH_EMPTY, HASH_EMPTY);
581 685
 	}
582 686
 
583
-	set_entry(via1, Via1);
584
-	set_entry(viA1, Via1);
585
-	set_entry(vIa1, Via1);
586
-	set_entry(vIA1, Via1);
587
-	set_entry(Via1, Via1);
588
-	set_entry(ViA1, Via1);
589
-	set_entry(VIa1, Via1);
590
-	set_entry(VIA1, Via1);
591
-	
592
-	set_entry(via2, Via2);
593
-	set_entry(viA2, Via2);
594
-	set_entry(vIa2, Via2);
595
-	set_entry(vIA2, Via2);
596
-	set_entry(Via2, Via2);
597
-	set_entry(ViA2, Via2);
598
-	set_entry(VIa2, Via2);
599
-	set_entry(VIA2, Via2);
600
-	
601
-	set_entry(from, From);
602
-	set_entry(froM, From);
603
-	set_entry(frOm, From);
604
-	set_entry(frOM, From);
605
-	set_entry(fRom, From);
606
-	set_entry(fRoM, From);
607
-	set_entry(fROm, From);
608
-	set_entry(fROM, From);
609
-	set_entry(From, From);
610
-	set_entry(FroM, From);
611
-	set_entry(FrOm, From);
612
-	set_entry(FrOM, From);
613
-	set_entry(FRom, From);
614
-	set_entry(FRoM, From);
615
-	set_entry(FROm, From);
616
-	set_entry(FROM, From);
617
-	
618
-	set_entry(to12, To12);
619
-	set_entry(tO12, To12);
620
-	set_entry(To12, To12);
621
-	set_entry(TO12, To12);
622
-
623
-	set_entry(to21, To21);
624
-	set_entry(tO21, To21);
625
-	set_entry(To21, To21);
626
-	set_entry(TO21, To21);
627
-
628
-	set_entry(cseq, CSeq);
629
-	set_entry(cseQ, CSeq);
630
-	set_entry(csEq, CSeq);
631
-	set_entry(csEQ, CSeq);
632
-	set_entry(cSeq, CSeq);
633
-	set_entry(cSeQ, CSeq);
634
-	set_entry(cSEq, CSeq);
635
-	set_entry(cSEQ, CSeq);
636
-	set_entry(Cseq, CSeq);
637
-	set_entry(CseQ, CSeq);
638
-	set_entry(CsEq, CSeq);
639
-	set_entry(CsEQ, CSeq);
640
-	set_entry(CSeq, CSeq);
641
-	set_entry(CSeQ, CSeq);
642
-	set_entry(CSEq, CSeq);
643
-	set_entry(CSEQ, CSeq);
644
-	
645
-	set_entry(call, Call);
646
-	set_entry(calL, Call);
647
-	set_entry(caLl, Call);
648
-	set_entry(caLL, Call);
649
-	set_entry(cAll, Call);
650
-	set_entry(cAlL, Call);
651
-	set_entry(cALl, Call);
652
-	set_entry(cALL, Call);
653
-	set_entry(Call, Call);
654
-	set_entry(CalL, Call);
655
-	set_entry(CaLl, Call);
656
-	set_entry(CaLL, Call);
657
-	set_entry(CAll, Call);
658
-	set_entry(CAlL, Call);
659
-	set_entry(CALl, Call);
660
-	set_entry(CALL, Call);
661
-
662
-	set_entry(_id1, _ID1);
663
-	set_entry(_iD1, _ID1);
664
-	set_entry(_Id1, _ID1);
665
-	set_entry(_ID1, _ID1);
666
-
667
-	set_entry(_id2, _ID2);
668
-	set_entry(_iD2, _ID2);
669
-	set_entry(_Id2, _ID2);
670
-	set_entry(_ID2, _ID2);
671
-
672
-	set_entry(cont, Cont);
673
-	set_entry(conT, Cont);
674
-	set_entry(coNt, Cont);
675
-	set_entry(coNT, Cont);
676
-	set_entry(cOnt, Cont);
677
-	set_entry(cOnT, Cont);
678
-	set_entry(cONt, Cont);
679
-	set_entry(cONT, Cont);
680
-	set_entry(Cont, Cont);
681
-	set_entry(ConT, Cont);
682
-	set_entry(CoNt, Cont);
683
-	set_entry(CoNT, Cont);
684
-	set_entry(COnt, Cont);
685
-	set_entry(COnT, Cont);
686
-	set_entry(CONt, Cont);
687
-	set_entry(CONT, Cont);
688
-
689
-	set_entry(act1, act1);
690
-	set_entry(acT1, act1);
691
-	set_entry(aCt1, act1);
692
-	set_entry(aCT1, act1);
693
-	set_entry(Act1, act1);
694
-	set_entry(AcT1, act1);
695
-	set_entry(ACt1, act1);
696
-	set_entry(ACT1, act1);
697
-
698
-	set_entry(act2, act2);
699
-	set_entry(acT2, act2);
700
-	set_entry(aCt2, act2);
701
-	set_entry(aCT2, act2);
702
-	set_entry(Act2, act2);
703
-	set_entry(AcT2, act2);
704
-	set_entry(ACt2, act2);
705
-	set_entry(ACT2, act2);
706
-
707
-	set_entry(max_, Max_);
708
-	set_entry(maX_, Max_);
709
-	set_entry(mAx_, Max_);
710
-	set_entry(mAX_, Max_);
711
-	set_entry(Max_, Max_);
712
-	set_entry(MaX_, Max_);
713
-	set_entry(MAx_, Max_);
714
-	set_entry(MAX_, Max_);
715
-
716
-	set_entry(forw, Forw);
717
-	set_entry(forW, Forw);
718
-	set_entry(foRw, Forw);
719
-	set_entry(foRW, Forw);
720
-	set_entry(fOrw, Forw);
721
-	set_entry(fOrW, Forw);
722
-	set_entry(fORw, Forw);
723
-	set_entry(fORW, Forw);
724
-	set_entry(Forw, Forw);
725
-	set_entry(ForW, Forw);
726
-	set_entry(FoRw, Forw);
727
-	set_entry(FoRW, Forw);
728
-	set_entry(FOrw, Forw);
729
-	set_entry(FOrW, Forw);
730
-	set_entry(FORw, Forw);
731
-	set_entry(FORW, Forw);
732
-
733
-	set_entry(ards, ards);
734
-	set_entry(ardS, ards);
735
-	set_entry(arDs, ards);
736
-	set_entry(arDS, ards);
737
-	set_entry(aRds, ards);
738
-	set_entry(aRdS, ards);
739
-	set_entry(aRDs, ards);
740
-	set_entry(aRDS, ards);
741
-	set_entry(Ards, ards);
742
-	set_entry(ArdS, ards);
743
-	set_entry(ArDs, ards);
744
-	set_entry(ArDS, ards);
745
-	set_entry(ARds, ards);
746
-	set_entry(ARdS, ards);
747
-	set_entry(ARDs, ards);
748
-	set_entry(ARDS, ards);
749
-
750
-	set_entry(rout, Rout);
751
-	set_entry(rouT, Rout);
752
-	set_entry(roUt, Rout);
753
-	set_entry(roUT, Rout);
754
-	set_entry(rOut, Rout);
755
-	set_entry(rOuT, Rout);
756
-	set_entry(rOUt, Rout);
757
-	set_entry(rOUT, Rout);
758
-	set_entry(Rout, Rout);
759
-	set_entry(RouT, Rout);
760
-	set_entry(RoUt, Rout);
761
-	set_entry(RoUT, Rout);
762
-	set_entry(ROut, Rout);
763
-	set_entry(ROuT, Rout);
764
-	set_entry(ROUt, Rout);
765
-	set_entry(ROUT, Rout);
766
-
767
-	set_entry(reco, Reco);
768
-	set_entry(recO, Reco);
769
-	set_entry(reCo, Reco);
770
-	set_entry(reCO, Reco);
771
-	set_entry(rEco, Reco);
772
-	set_entry(rEcO, Reco);
773
-	set_entry(rECo, Reco);
774
-	set_entry(rECO, Reco);
775
-	set_entry(Reco, Reco);
776
-	set_entry(RecO, Reco);
777
-	set_entry(ReCo, Reco);
778
-	set_entry(ReCO, Reco);
779
-	set_entry(REco, Reco);
780
-	set_entry(REcO, Reco);
781
-	set_entry(RECo, Reco);
782
-	set_entry(RECO, Reco);
783
-
784
-	set_entry(rd_r, rd_R);
785
-	set_entry(rd_R, rd_R);
786
-	set_entry(rD_r, rd_R);
787
-	set_entry(rD_R, rd_R);
788
-	set_entry(Rd_r, rd_R);
789
-	set_entry(Rd_R, rd_R);
790
-	set_entry(RD_r, rd_R);
791
-	set_entry(RD_R, rd_R);
792
-
793
-	set_entry(oute, oute);
794
-	set_entry(outE, oute);
795
-	set_entry(ouTe, oute);
796
-	set_entry(ouTE, oute);
797
-	set_entry(oUte, oute);
798
-	set_entry(oUtE, oute);
799
-	set_entry(oUTe, oute);
800
-	set_entry(oUTE, oute);
801
-	set_entry(Oute, oute);
802
-	set_entry(OutE, oute);
803
-	set_entry(OuTe, oute);
804
-	set_entry(OuTE, oute);
805
-	set_entry(OUte, oute);
806
-	set_entry(OUtE, oute);
807
-	set_entry(OUTe, oute);
808
-	set_entry(OUTE, oute);
809
-}
810
-
687
+	k = 0;
811 688
 
689
+	for(i = 0; i < NUM_VALS; i++) {
690
+		for(j = 0; j < key_nums[i]; j++) {
691
+			set_entry(init_key[k++], init_val[i]);
692
+		}
693
+	}
694
+}
... ...
@@ -9,7 +9,7 @@
9 9
 
10 10
 
11 11
 /*
12
- * Yet another parse_hname - Ultra Fast version :-)
12
+ * Fast 32-bit header field name parser
13 13
  */
14 14
 char* parse_hname2(char* begin, char* end, struct hdr_field* hdr);
15 15