Browse code

misctest: allow testing with larger message size than core accepts

(cherry picked from commit 598969df126af4ad4d2283e37078e1afe8773a32)

Daniel-Constantin Mierla authored on 05/10/2022 08:41:38
Showing 1 changed files
... ...
@@ -265,13 +265,13 @@ error:
265 265
 
266 266
 static int misctest_message_init(void)
267 267
 {
268
-	char tbuf[BUF_SIZE];
268
+	char tbuf[4*BUF_SIZE];
269 269
 	FILE *f;
270 270
 	long fsize;
271 271
 	sip_msg_t tmsg = { };
272 272
 
273 273
 	if(misctest_message_data.s!=0 && misctest_message_data.len>0) {
274
-		if(misctest_message_data.len>=BUF_SIZE-2) {
274
+		if(misctest_message_data.len>=4*BUF_SIZE-2) {
275 275
 			LM_ERR("the data is too big\n");
276 276
 			return -1;
277 277
 		}
... ...
@@ -297,7 +297,7 @@ static int misctest_message_init(void)
297 297
 		}
298 298
 		fseek(f, 0, SEEK_SET);
299 299
 
300
-		if(fsize>=BUF_SIZE-2) {
300
+		if(fsize>=4*BUF_SIZE-2) {
301 301
 			LM_ERR("the file data is too big\n");
302 302
 			fclose(f);
303 303
 			return -1;