Browse code

secsipid: set file caching options if modparams are provided

Daniel-Constantin Mierla authored on 17/11/2020 10:53:22
Showing 1 changed files
... ...
@@ -348,6 +348,9 @@ static sr_kemi_xval_t* ki_secsipid_get_url(sip_msg_t *msg, str *surl)
348 348
 		_secsipid_get_url_val.len = 0;
349 349
 	}
350 350
 
351
+	if(secsipid_cache_dir.len > 0) {
352
+		SecSIPIDSetFileCacheOptions(secsipid_cache_dir.s, secsipid_cache_expire);
353
+	}
351 354
 	r = SecSIPIDGetURLContent(surl->s, secsipid_timeout, &_secsipid_get_url_val.s,
352 355
 			&_secsipid_get_url_val.len);
353 356
 	if(r!=0) {
... ...
@@ -380,6 +383,9 @@ static int w_secsipid_get_url(sip_msg_t *msg, char *purl, char *povar)
380 383
 		_secsipid_get_url_val.len = 0;
381 384
 	}
382 385
 
386
+	if(secsipid_cache_dir.len > 0) {
387
+		SecSIPIDSetFileCacheOptions(secsipid_cache_dir.s, secsipid_cache_expire);
388
+	}
383 389
 	r = SecSIPIDGetURLContent(surl.s, secsipid_timeout, &_secsipid_get_url_val.s,
384 390
 			&_secsipid_get_url_val.len);
385 391
 	if(r!=0) {