Module: kamailio
Branch: master
Commit: 61677fed1b693fbb163ecd8dcd9d9ae37e4da066
URL:
https://github.com/kamailio/kamailio/commit/61677fed1b693fbb163ecd8dcd9d9ae…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-07T17:34:51+02:00
sqlops: new modparam results_maxsize
- allow setting the maximum size of the result containers list
---
Modified: src/modules/sqlops/sql_api.c
Modified: src/modules/sqlops/sqlops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/61677fed1b693fbb163ecd8dcd9d9ae…
Patch:
https://github.com/kamailio/kamailio/commit/61677fed1b693fbb163ecd8dcd9d9ae…
---
diff --git a/src/modules/sqlops/sql_api.c b/src/modules/sqlops/sql_api.c
index 748d77320e..d67f30ccef 100644
--- a/src/modules/sqlops/sql_api.c
+++ b/src/modules/sqlops/sql_api.c
@@ -35,7 +35,7 @@
#include "sql_api.h"
-#define SQLOPS_RESULT_MAXSIZE 32
+extern int sqlops_results_maxsize;
sql_con_t *_sql_con_root = NULL;
sql_result_t *_sql_result_root = NULL;
@@ -225,7 +225,7 @@ sql_result_t* sql_get_result(str *name)
i++;
sr = sr->next;
}
- if(i>SQLOPS_RESULT_MAXSIZE)
+ if(i>sqlops_results_maxsize)
{
LM_ERR("too many result containers defined\n");
return NULL;
diff --git a/src/modules/sqlops/sqlops.c b/src/modules/sqlops/sqlops.c
index 5eec552b65..fb35907d59 100644
--- a/src/modules/sqlops/sqlops.c
+++ b/src/modules/sqlops/sqlops.c
@@ -79,6 +79,8 @@ static int sql_res_param(modparam_t type, void* val);
extern int sqlops_tr_buf_size;
+int sqlops_results_maxsize = 32;
+
static int sqlops_connect_mode = 0;
static pv_export_t mod_pvs[] = {
@@ -111,6 +113,7 @@ static param_export_t params[]={
{"sqlres", PARAM_STRING|USE_FUNC_PARAM, (void*)sql_res_param},
{"tr_buf_size", PARAM_INT, &sqlops_tr_buf_size},
{"connect_mode", PARAM_INT, &sqlops_connect_mode},
+ {"results_maxsize", PARAM_INT, &sqlops_results_maxsize},
{0,0,0}
};