rem: case HDR_WWWAUTH: case HDR_SUPPORTED: case HDR_REQUIRE:
context: char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr){	char* tmp;	char *match;	struct via_body *vb;	struct cseq_body* cseq_b;	struct to_body* to_b;	int integer;	if ((*buf)=='\n' || (*buf)=='\r'){		/* double crlf or lflf or crcr */		DBG("found end of header\n");		hdr->type=HDR_EOH;		return buf;	}	tmp=parse_hname(buf, end, hdr);	if (hdr->type==HDR_ERROR){		LOG(L_ERR, "ERROR: get_hdr_field: bad header\n");		goto error;	}	/* eliminate leading whitespace */	tmp=eat_lws_end(tmp, end);	if (tmp>=end) {		LOG(L_ERR, "ERROR: get_hdr_field: HF empty\n");		goto error;	}	/* if header-field well-known, parse it, find its end otherwise ;	 * after leaving the hdr->type switch, tmp should be set to the	 * next header field	 */	switch(hdr->type){		case HDR_VIA:			/* keep number of vias parsed -- we want to report it in			   replies for diagnostic purposes */			via_cnt++;			vb=pkg_malloc(sizeof(struct via_body));			if (vb==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(vb,0,sizeof(struct via_body));			hdr->body.s=tmp;			tmp=parse_via(tmp, end, vb);			if (vb->error==PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad via\n");				pkg_free(vb);				goto error;			}			hdr->parsed=vb;			vb->hdr.s=hdr->name.s;			vb->hdr.len=hdr->name.len;			hdr->body.len=tmp-hdr->body.s;			break;		case HDR_CSEQ:			cseq_b=pkg_malloc(sizeof(struct cseq_body));			if (cseq_b==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(cseq_b, 0, sizeof(struct cseq_body));			hdr->body.s=tmp;			tmp=parse_cseq(tmp, end, cseq_b);			if (cseq_b->error==PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad cseq\n");				pkg_free(cseq_b);				goto error;			}			hdr->parsed=cseq_b;			hdr->body.len=tmp-hdr->body.s;			DBG("get_hdr_field: cseq <%.*s>: <%.*s> <%.*s>\n",					hdr->name.len, ZSW(hdr->name.s), 					cseq_b->number.len, ZSW(cseq_b->number.s), 					cseq_b->method.len, cseq_b->method.s);			break;		case HDR_TO:			to_b=pkg_malloc(sizeof(struct to_body));			if (to_b==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(to_b, 0, sizeof(struct to_body));			hdr->body.s=tmp;			tmp=parse_to(tmp, end,to_b);			if (to_b->error==PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad to header\n");				pkg_free(to_b);				goto error;			}			hdr->parsed=to_b;			hdr->body.len=tmp-hdr->body.s;			DBG("DEBUG: get_hdr_field: <%.*s> [%d]; uri=[%.*s] \n",				hdr->name.len, ZSW(hdr->name.s), 				hdr->body.len, to_b->uri.len,ZSW(to_b->uri.s));			DBG("DEBUG: to body [%.*s]\n",to_b->body.len,				ZSW(to_b->body.s));			break;		case HDR_CONTENTLENGTH:			hdr->body.s=tmp;			tmp=parse_content_length(tmp,end, &integer);			if (tmp==0){				LOG(L_ERR, "ERROR:get_hdr_field: bad content_length header\n");				goto error;			}			hdr->parsed=(void*)(long)integer;			hdr->body.len=tmp-hdr->body.s;			DBG("DEBUG: get_hdr_body : content_length=%d\n",					(int)(long)hdr->parsed);			break;		case HDR_CONTENTTYPE:		case HDR_FROM:		case HDR_CALLID:		case HDR_CONTACT:		case HDR_ROUTE:		case HDR_RECORDROUTE:		case HDR_MAXFORWARDS:		case HDR_AUTHORIZATION:		case HDR_EXPIRES:		case HDR_PROXYAUTH:		case HDR_WWWAUTH:		case HDR_SUPPORTED:		case HDR_REQUIRE:		case HDR_PROXYREQUIRE:		case HDR_UNSUPPORTED:		case HDR_ALLOW:		case HDR_EVENT:	        case HDR_ACCEPT:		case HDR_OTHER:			/* just skip over it */			hdr->body.s=tmp;			/* find end of header */			/* find lf */			do{				match=q_memchr(tmp, '\n', end-tmp);				if (match){					match++;				}else {					LOG(L_ERR,							"ERROR: get_hdr_field: bad body for <%s>(%d)\n",							hdr->name.s, hdr->type);					/* abort(); */					tmp=end;					goto error;				}				tmp=match;			}while( match<end &&( (*match==' ')||(*match=='\t') ) );			tmp=match;			hdr->body.len=match-hdr->body.s;			break;		default:			LOG(L_CRIT, "BUG: get_hdr_field: unknown header type %d\n",					hdr->type);			goto error;	}	/* jku: if \r covered by current length, shrink it */	trim_r( hdr->body );	hdr->len=tmp-hdr->name.s;	return tmp;error:	DBG("get_hdr_field: error exit\n");	hdr->type=HDR_ERROR;	hdr->len=tmp-hdr->name.s;	return tmp;}