Browse code

parser/parse_fline: print offset in log message when failing to parse first line

Daniel-Constantin Mierla authored on 26/02/2014 19:30:34
Showing 1 changed files
... ...
@@ -77,6 +77,7 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl)
77 77
 	*/
78 78
 	
79 79
 
80
+	offset = 0;
80 81
 	end=buffer+len;
81 82
 	/* see if it's a reply (status) */
82 83
 
... ...
@@ -239,7 +240,7 @@ error:
239 240
 	};
240 241
 error1:
241 242
 	fl->type=SIP_INVALID;
242
-	LOG(L_ERR, "parse_first_line: bad message\n");
243
+	LOG(L_ERR, "parse_first_line: bad message (offset: %d)\n", offset);
243 244
 	/* skip  line */
244 245
 	nl=eat_line(buffer,len);
245 246
 	return nl;