Browse code

- fixed bug in parse_hname (some HEADER_UNKNOWN/OTHER not properly parsed)

Andrei Pelinescu-Onciul authored on 04/12/2001 06:47:58
Showing 1 changed files
... ...
@@ -87,6 +87,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
87 87
 			case 'A':
88 88
 			case 'a':
89 89
 					switch(state){
90
+						case INITIAL:
91
+								state=UNKNOWN_HEADER;
92
+								hdr->name.s=t;
93
+								break;
90 94
 						case VIA2:
91 95
 								state=F_VIA;
92 96
 								break;
... ...
@@ -146,6 +150,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
146 150
 			case 'O':
147 151
 			case 'o':
148 152
 					switch(state){
153
+						case INITIAL:
154
+								state=UNKNOWN_HEADER;
155
+								hdr->name.s=t;
156
+								break;
149 157
 						case FROM2:
150 158
 							state=FROM3;
151 159
 							break;
... ...
@@ -220,6 +228,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
220 228
 			case 'S':
221 229
 			case 's':
222 230
 						switch(state){
231
+							case INITIAL:
232
+								state=UNKNOWN_HEADER;
233
+								hdr->name.s=t;
234
+								break;
223 235
 							case C_START:
224 236
 								state=CSEQ2;
225 237
 								break;
... ...
@@ -234,6 +246,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
234 246
 			case 'E':
235 247
 			case 'e':
236 248
 						switch(state){
249
+							case INITIAL:
250
+								state=UNKNOWN_HEADER;
251
+								hdr->name.s=t;
252
+								break;
237 253
 							case CSEQ2:
238 254
 								state=CSEQ3;
239 255
 								break;
... ...
@@ -248,6 +264,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
248 264
 			case 'Q':
249 265
 			case 'q':
250 266
 						switch(state){
267
+							case INITIAL:
268
+								state=UNKNOWN_HEADER;
269
+								hdr->name.s=t;
270
+								break;
251 271
 							case CSEQ3:
252 272
 								state=F_CSEQ;
253 273
 								break;
... ...
@@ -259,6 +279,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
259 279
 			case 'L':
260 280
 			case 'l':
261 281
 						switch(state){
282
+							case INITIAL:
283
+								state=UNKNOWN_HEADER;
284
+								hdr->name.s=t;
285
+								break;
262 286
 							case CALLID2:
263 287
 								state=CALLID3;
264 288
 								break;
... ...
@@ -273,6 +297,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
273 297
 			case 'D':
274 298
 			case 'd':
275 299
 						switch(state){
300
+							case INITIAL:
301
+								state=UNKNOWN_HEADER;
302
+								hdr->name.s=t;
303
+								break;
276 304
 							case CALLID6:
277 305
 								state=F_CALLID;
278 306
 								break;
... ...
@@ -287,6 +315,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
287 315
 			case 'N':
288 316
 			case 'n':
289 317
 						switch(state){
318
+							case INITIAL:
319
+								state=UNKNOWN_HEADER;
320
+								hdr->name.s=t;
321
+								break;
290 322
 							case CONTACT2:
291 323
 								state=CONTACT3;
292 324
 								break;
... ...
@@ -298,6 +330,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
298 330
 			case 'X':
299 331
 			case 'x':
300 332
 						switch(state){
333
+							case INITIAL:
334
+								state=UNKNOWN_HEADER;
335
+								hdr->name.s=t;
336
+								break;
301 337
 							case MAXFORWARDS2:
302 338
 								state=MAXFORWARDS3;
303 339
 								break;
... ...
@@ -308,6 +344,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
308 344
 						break;
309 345
 			case '-':
310 346
 						switch(state){
347
+							case INITIAL:
348
+								state=UNKNOWN_HEADER;
349
+								hdr->name.s=t;
350
+								break;
311 351
 							case CALLID4:
312 352
 								state=CALLID5;
313 353
 								break;
... ...
@@ -322,6 +362,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
322 362
 			case 'W':
323 363
 			case 'w':
324 364
 						switch(state){
365
+							case INITIAL:
366
+								state=UNKNOWN_HEADER;
367
+								hdr->name.s=t;
368
+								break;
325 369
 							case MAXFORWARDS7:
326 370
 								state=MAXFORWARDS8;
327 371
 								break;
... ...
@@ -333,6 +377,10 @@ char* parse_hname(char* p, char* end, struct hdr_field* hdr)
333 377
 			case 'U':
334 378
 			case 'u':
335 379
 						switch(state){
380
+							case INITIAL:
381
+								state=UNKNOWN_HEADER;
382
+								hdr->name.s=t;
383
+								break;
336 384
 							case ROUTE2:
337 385
 								state=ROUTE3;
338 386
 								break;