Browse Source

core: more verbose when error parsing hdr

- give a hint about the content parsing (max first 20 chars of attempted
  string)
Daniel-Constantin Mierla 15 years ago
parent
commit
78e8075eea
1 changed files with 2 additions and 1 deletions
  1. 2 1
      parser/msg_parser.c

+ 2 - 1
parser/msg_parser.c

@@ -335,7 +335,8 @@ int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next)
 		rest=get_hdr_field(tmp, end, hf);
 		rest=get_hdr_field(tmp, end, hf);
 		switch (hf->type){
 		switch (hf->type){
 			case HDR_ERROR_T:
 			case HDR_ERROR_T:
-				LOG(L_INFO,"ERROR: bad header  field\n");
+				LOG(L_INFO,"ERROR: bad header field [%.*s]\n",
+					(end-tmp>20)?20:(end-tmp), tmp);
 				goto  error;
 				goto  error;
 			case HDR_EOH_T:
 			case HDR_EOH_T:
 				msg->eoh=tmp; /* or rest?*/
 				msg->eoh=tmp; /* or rest?*/