Преглед на файлове

core: more verbose when error parsing hdr

- give a hint about the content parsing (max first 20 chars of attempted
  string)
(cherry picked from commit 78e8075eea603a854dcf0142dda0f1dae6c69857)
Daniel-Constantin Mierla преди 15 години
родител
ревизия
ec538071e9
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      parser/msg_parser.c

+ 2 - 1
parser/msg_parser.c

@@ -333,7 +333,8 @@ int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next)
 		rest=get_hdr_field(tmp, end, hf);
 		switch (hf->type){
 			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;
 			case HDR_EOH_T:
 				msg->eoh=tmp; /* or rest?*/