TT#110300 remove already applied patches

* refresh patches

Change-Id: I427ad49005ae0082dca8a63533bc054c00c79253
mr8.5.5
Victor Seva 5 years ago
parent d6b9dacd70
commit dc0c652f3f

@ -7,10 +7,10 @@ Subject: no_lib64_on_64_bits
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 460a589..607350d 100644
index 83e48e6..4ca496b 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -452,15 +452,7 @@ endif
@@ -454,15 +454,7 @@ endif
$(info target architecture <$(ARCH)>, host architecture <$(HOST_ARCH)>)

@ -61,9 +61,6 @@ upstream/pv-add-KEMI-functions-pvx.xavp_get_keys-and-pvx.xavp.patch
upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch
upstream/cfgt-don-t-process-non-sip-messages.patch
upstream/cfgt-fix-implicit-declaration-of-strcasestr.patch
upstream/core-str-helper-macro-to-set-ending-zero-with-backup.patch
upstream/core-str-fixed-wrong-undo-ed-version-of-STR_ZTOV-mac.patch
upstream/jansson-use-the-core-macros-for-ending-string-value-.patch
upstream/core-add-case-functions-for-str_hash-get-and-set.patch
upstream/core-xavi-api-like-xavp-but-with-insensitive-case-na.patch
upstream/pv-define-xavi-types.patch
@ -73,11 +70,10 @@ upstream/pv-xavi-.-config-variables-implementation.patch
upstream/core-PV_IDX_NONE-to-point-that-pv-had-no-index.patch
upstream/pv-fix-for-new-PV_IDX_NONE-value.patch
upstream/pv_headers-fix-x_hdr-index-on-get.patch
upstream/ndb_redis-set-message-level-to-debug-on-exec.patch
## backport from kamailio trunk (5.3)
#
# upstream master (5.5)
upstream/ndb_redis-set-message-level-to-debug-on-reconnect.patch
#
### relevant for upstream
#
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
@ -91,7 +87,6 @@ sipwise/db_redis_sscan.patch
### active development
sipwise/pua-fix-send_publish-behavior-on-PUA_DB_ONLY.patch
sipwise/pua-update_version_puadb-use-pres_id-to-select-recor.patch
sipwise/fix-db-redis-key-expiry.patch
#
### Don't just put stuff in any order
### use gbp pq import/export tooling to help maintain patches

@ -1,31 +0,0 @@
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -1688,12 +1688,6 @@
if (tmp)
db_redis_key_free(&tmp);
- // skip if delete all rows
- if (!*manual_keys_count) {
- db_redis_key_free (&query_v);
- goto skipkeys;
- }
-
if (db_redis_key_prepend_string(&query_v, "HMGET", 5) != 0) {
LM_ERR("Failed to set hmget command to pre-delete query\n");
goto error;
@@ -1785,7 +1779,6 @@
db_vals = NULL;
db_redis_free_reply(&reply);
- skipkeys:
if (db_redis_key_add_string(&query_v, "DEL", 3) != 0) {
LM_ERR("Failed to add del command to delete query\n");
goto error;
@@ -2645,6 +2638,7 @@
} else {
LM_DBG("no columns given to build query keys, falling back to full table scan\n");
keys_count = 0;
+ do_table_scan = 1;
}
if (db_redis_perform_delete(_h, con, _k, _v, query_ops, _n,

@ -7,10 +7,10 @@ Subject: pv_trans_eval_uri
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index dfc842a..81299be 100644
index b95ffd1..3889b41 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -1310,8 +1310,8 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int subtype,
@@ -1311,8 +1311,8 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int subtype,
/* parse uri -- params only when requested */
if(parse_uri(_tr_uri.s, _tr_uri.len - dlen, &_tr_parsed_uri)!=0)
{

@ -7,7 +7,7 @@ Subject: usrloc_dbro_pinger
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/modules/usrloc/dlist.c b/src/modules/usrloc/dlist.c
index 5148c9d..c244d6e 100644
index 7535cfd..271e0cf 100644
--- a/src/modules/usrloc/dlist.c
+++ b/src/modules/usrloc/dlist.c
@@ -115,6 +115,8 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,

@ -9,7 +9,7 @@ Subject: [PATCH] avpops: add avp_subst_pv()
1 file changed, 58 insertions(+)
diff --git a/src/modules/avpops/avpops.c b/src/modules/avpops/avpops.c
index 6e49933..06f5f1f 100644
index d981675..f2c0b93 100644
--- a/src/modules/avpops/avpops.c
+++ b/src/modules/avpops/avpops.c
@@ -68,6 +68,8 @@ static int fixup_pushto_avp(void** param, int param_no);

@ -7,7 +7,7 @@ Subject: core: receive - reset xavi list after message processing
1 file changed, 1 insertion(+)
diff --git a/src/core/receive.c b/src/core/receive.c
index 550ec59..e23de0f 100644
index ba488a5..3d193d1 100644
--- a/src/core/receive.c
+++ b/src/core/receive.c
@@ -560,4 +560,5 @@ void ksr_msg_env_reset(void)

@ -1,22 +0,0 @@
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon, 27 Apr 2020 15:24:23 +0200
Subject: [PATCH] core: str - fixed wrong (undo'ed) version of STR_ZTOV()
macro
---
src/core/str.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/str.h b/src/core/str.h
index 83334b8..01b12ec 100644
--- a/src/core/str.h
+++ b/src/core/str.h
@@ -137,7 +137,7 @@ typedef struct _str str;
if (v != '\0') { \
c = v; \
} \
- }
+ } while(0)
/** @} */

@ -1,124 +0,0 @@
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon, 27 Apr 2020 14:53:33 +0200
Subject: [PATCH] core: str - helper macro to set ending zero with backup and
restore from backup
---
src/core/str.h | 57 ++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/src/core/str.h b/src/core/str.h
index de226c7..83334b8 100644
--- a/src/core/str.h
+++ b/src/core/str.h
@@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -23,23 +23,23 @@
#include <string.h>
-/** @defgroup str_string Counted-Length Strings
+/** @defgroup str_string Counted-Length Strings
* @{
- *
+ *
* Implementation of counted-length strings. In SER and its modules, strings
* are often stored in the ::str structure. In addition to the pointer
* pointing to the first character of the string, the structure also contains
* the length of the string.
- *
+ *
* @section motivation Motivation
* Storing the length of the string together with the pointer to the string
* has two advantages. First, it makes many string operations faster because
* it is not necessary to count the number of characters at runtime. Second,
* the pointer can point to arbitrary substrings within a SIP message (which
* itself is stored as one long string spanning the whole message) without the
- * need to make a zero-terminated copy of it.
+ * need to make a zero-terminated copy of it.
*
- * @section drawbacks Drawbacks
+ * @section drawbacks Drawbacks
* Note well that the fact that string stored
* using this data structure are not zero terminated makes them a little
* incovenient to use with many standard libc string functions, because these
@@ -49,7 +49,7 @@
* characters is considered to be dangerous.
*/
-/** @file
+/** @file
* This header field defines the ::str data structure that is used across
* SER sources to store counted-length strings. The file also defines several
* convenience macros.
@@ -91,13 +91,13 @@ typedef struct _str str;
#define STR_NULL {0, 0}
/** Formats ::str string for use in printf-like functions.
- * This is a macro that prepares a ::str string for use in functions which
- * use printf-like formatting strings. This macro is necessary because
- * ::str strings do not have to be zero-terminated and thus it is necessary
- * to provide printf-like functions with the number of characters in the
- * string manually. Here is an example how to use the macro:
- * \code printf("%.*s\n", STR_FMT(var));\endcode Note well that the correct
- * sequence in the formatting string is %.*, see the man page of printf for
+ * This is a macro that prepares a ::str string for use in functions which
+ * use printf-like formatting strings. This macro is necessary because
+ * ::str strings do not have to be zero-terminated and thus it is necessary
+ * to provide printf-like functions with the number of characters in the
+ * string manually. Here is an example how to use the macro:
+ * \code printf("%.*s\n", STR_FMT(var));\endcode Note well that the correct
+ * sequence in the formatting string is %.*, see the man page of printf for
* more details.
*/
#define STR_FMT(_pstr_) \
@@ -106,8 +106,8 @@ typedef struct _str str;
/** Compares two ::str strings.
- * This macro implements comparison of two strings represented using ::str
- * structures. First it compares the lengths of both string and if and only
+ * This macro implements comparison of two strings represented using ::str
+ * structures. First it compares the lengths of both string and if and only
* if they are same then both strings are compared using memcmp.
* @param x is first string to be compared
* @param y is second string to be compared
@@ -116,6 +116,29 @@ typedef struct _str str;
#define STR_EQ(x,y) (((x).len == (y).len) && \
(memcmp((x).s, (y).s, (x).len) == 0))
+/**
+ * If c != '\0', backup c in v and set c = '\0'
+ * - useful to terminate str->s with '\0' (if not already '\0'), keeping original
+ * value in v, to be able to restore with STR_ZTOV(...)
+ */
+#define STR_VTOZ(c,v) do { \
+ v = '\0'; \
+ if(c!='\0') { \
+ v = c; \
+ c = '\0'; \
+ } \
+ } while(0)
+
+/**
+ * If v != '\0', set c = v
+ * - restore original value after using STR_VTOZ(...)
+ */
+#define STR_ZTOV(c,v) do { \
+ if (v != '\0') { \
+ c = v; \
+ } \
+ }
+
/** @} */
/** Appends a sufffix

@ -77,7 +77,7 @@ index b137d80..2239283 100644
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 97fd19e..919cde7 100644
index c0dc5f6..863968a 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -27,6 +27,8 @@
@ -796,7 +796,7 @@ index 97fd19e..919cde7 100644
static int db_redis_compare_column(db_key_t k, db_val_t *v, db_op_t op, redisReply *reply) {
int i_value;
long long ll_value;
@@ -1073,7 +1426,8 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
@@ -1075,7 +1428,8 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
const db_val_t* _v, const db_op_t *_op, const db_key_t* _c,
const int _n, const int _nc, db1_res_t** _r,
redis_key_t **keys, int *keys_count,
@ -806,7 +806,7 @@ index 97fd19e..919cde7 100644
redisReply *reply = NULL;
redis_key_t *query_v = NULL;
@@ -1101,9 +1455,9 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
@@ -1103,9 +1457,9 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
LM_WARN(" scan key %d is '%.*s'\n",
i, _k[i]->len, _k[i]->s);
}
@ -818,7 +818,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -1253,7 +1607,8 @@ error:
@@ -1255,7 +1609,8 @@ error:
static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, const db_key_t* _k,
const db_val_t* _v, const db_op_t *_op, const int _n,
redis_key_t **keys, int *keys_count,
@ -828,7 +828,7 @@ index 97fd19e..919cde7 100644
int i = 0, j = 0;
redis_key_t *k = NULL;
@@ -1264,21 +1619,29 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1266,21 +1621,29 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
redisReply *reply = NULL;
redis_key_t *query_v = NULL;
redis_key_t *type_keys = NULL;
@ -862,7 +862,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -1412,7 +1775,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1408,7 +1771,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
}
}
if (db_redis_build_type_keys(con, CON_TABLE(_h), db_keys, db_vals, all_type_keys_count,
@ -871,7 +871,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to build type keys\n");
goto error;
}
@@ -1437,8 +1800,18 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1432,8 +1795,18 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
db_redis_check_reply(con, reply, error);
db_redis_free_reply(&reply);
@ -892,7 +892,7 @@ index 97fd19e..919cde7 100644
LM_ERR("Failed to add srem command to post-delete query\n");
goto error;
}
@@ -1446,6 +1819,10 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1441,6 +1814,10 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
LM_ERR("Failed to add key to delete query\n");
goto error;
}
@ -903,7 +903,7 @@ index 97fd19e..919cde7 100644
if (db_redis_key_add_str(&query_v, key) != 0) {
LM_ERR("Failed to add key to delete query\n");
goto error;
@@ -1457,6 +1834,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1452,6 +1829,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
}
LM_DBG("done with loop '%.*s'\n", k->key.len, k->key.s);
db_redis_key_free(&type_keys);
@ -911,7 +911,7 @@ index 97fd19e..919cde7 100644
}
db_redis_key_free(&all_type_keys);
db_redis_key_free(&query_v);
@@ -1473,6 +1851,7 @@ error:
@@ -1468,6 +1846,7 @@ error:
pkg_free(db_vals);
db_redis_key_free(&query_v);
db_redis_key_free(&type_keys);
@ -919,7 +919,7 @@ index 97fd19e..919cde7 100644
db_redis_key_free(&all_type_keys);
return -1;
}
@@ -1481,7 +1860,8 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1476,7 +1855,8 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
const db_val_t* _v, const db_op_t *_op, const db_key_t* _uk, const db_val_t *_uv,
const int _n, const int _nu,
redis_key_t **keys, int *keys_count,
@ -929,7 +929,7 @@ index 97fd19e..919cde7 100644
redisReply *reply = NULL;
redis_key_t *query_v = NULL;
@@ -1490,6 +1870,16 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1485,6 +1865,16 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
int i;
int j;
size_t col;
@ -946,7 +946,7 @@ index 97fd19e..919cde7 100644
if (!(*keys_count) && do_table_scan) {
LM_WARN("performing full table scan on table '%.*s' while performing update\n",
@@ -1498,18 +1888,35 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1493,18 +1883,35 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
LM_WARN(" scan key %d is '%.*s'\n",
i, _k[i]->len, _k[i]->s);
}
@ -985,7 +985,7 @@ index 97fd19e..919cde7 100644
if (db_redis_key_add_string(&query_v, "EXISTS", 6) != 0) {
@@ -1527,19 +1934,9 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1522,19 +1929,9 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
db_redis_key_free(&query_v);
// construct HMGET query
@ -1008,7 +1008,7 @@ index 97fd19e..919cde7 100644
}
if (db_redis_key_add_str(&query_v, keyname) != 0) {
LM_ERR("Failed to add key name to pre-update exists query\n");
@@ -1554,6 +1951,13 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1549,6 +1946,13 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
goto error;
}
}
@ -1022,7 +1022,7 @@ index 97fd19e..919cde7 100644
if (db_redis_append_command_argv(con, query_v, 1) != REDIS_OK) {
LM_ERR("Failed to append redis command\n");
@@ -1580,9 +1984,13 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1575,9 +1979,13 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
for (key = *keys; key; key = key->next) {
@ -1037,7 +1037,7 @@ index 97fd19e..919cde7 100644
// get reply for EXISTS query
if (db_redis_get_reply(con, (void**)&reply) != REDIS_OK) {
@@ -1639,13 +2047,50 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1634,13 +2042,50 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
}
}
}
@ -1089,7 +1089,7 @@ index 97fd19e..919cde7 100644
if (db_redis_key_add_string(&query_v, "HMSET", 5) != 0) {
LM_ERR("Failed to add hmset command to update query\n");
goto error;
@@ -1681,6 +2126,108 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1676,6 +2121,108 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
}
db_redis_key_free(&query_v);
@ -1198,7 +1198,7 @@ index 97fd19e..919cde7 100644
}
LM_DBG("getting replies for %d queries\n", update_queries);
@@ -1697,6 +2244,8 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
@@ -1692,6 +2239,8 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
LM_DBG("done performing update\n");
@ -1207,7 +1207,7 @@ index 97fd19e..919cde7 100644
return 0;
error:
@@ -1704,6 +2253,10 @@ error:
@@ -1699,6 +2248,10 @@ error:
if (reply)
db_redis_free_reply(&reply);
db_redis_key_free(&query_v);
@ -1218,7 +1218,7 @@ index 97fd19e..919cde7 100644
return -1;
}
@@ -1726,6 +2279,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -1721,6 +2274,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
km_redis_con_t *con = NULL;
int free_op = 0;
int do_table_scan = 0;
@ -1227,7 +1227,7 @@ index 97fd19e..919cde7 100644
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -1796,7 +2351,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -1791,7 +2346,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
@ -1237,7 +1237,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -1814,7 +2370,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -1809,7 +2365,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
if (db_redis_perform_query(_h, con, _k, _v, query_ops, _c, _n, _nc, _r,
@ -1246,7 +1246,7 @@ index 97fd19e..919cde7 100644
goto error;
}
@@ -1828,6 +2384,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -1823,6 +2379,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
if (manual_keys) {
pkg_free(manual_keys);
}
@ -1255,7 +1255,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
return 0;
@@ -1841,6 +2399,8 @@ error:
@@ -1836,6 +2394,8 @@ error:
if (manual_keys) {
pkg_free(manual_keys);
}
@ -1264,7 +1264,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
@@ -1869,11 +2429,13 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
@@ -1864,11 +2424,13 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
redis_key_t *key = NULL;
int keys_count = 0;
redis_key_t *type_keys = NULL;
@ -1278,7 +1278,7 @@ index 97fd19e..919cde7 100644
con = REDIS_CON(_h);
if (con && con->con == NULL) {
@@ -1900,7 +2462,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
@@ -1895,7 +2457,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
goto error;
}
if (db_redis_build_type_keys(con, CON_TABLE(_h), _k, _v, _n,
@ -1287,7 +1287,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to build type keys\n");
goto error;
}
@@ -1939,7 +2501,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
@@ -1934,7 +2496,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
db_redis_check_reply(con, reply, error);
db_redis_free_reply(&reply);
@ -1296,7 +1296,7 @@ index 97fd19e..919cde7 100644
str *type_key = &k->key;
LM_DBG("inserting entry key '%.*s' to type map '%.*s'\n",
@@ -1962,10 +2524,29 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
@@ -1957,10 +2519,29 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
db_redis_key_free(&query_v);
db_redis_check_reply(con, reply, error);
db_redis_free_reply(&reply);
@ -1326,7 +1326,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
return 0;
@@ -1973,6 +2554,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
@@ -1968,6 +2549,7 @@ int db_redis_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
error:
db_redis_key_free(&key);
db_redis_key_free(&type_keys);
@ -1334,7 +1334,7 @@ index 97fd19e..919cde7 100644
db_redis_key_free(&query_v);
if (reply)
@@ -2002,6 +2584,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -1997,6 +2579,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
int manual_keys_count = 0;
int free_op = 0;
int do_table_scan = 0;
@ -1343,7 +1343,7 @@ index 97fd19e..919cde7 100644
db_op_t *query_ops = NULL;
int i;
@@ -2046,7 +2630,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2041,7 +2625,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
@ -1353,7 +1353,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2063,7 +2648,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2059,7 +2644,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_delete(_h, con, _k, _v, query_ops, _n,
@ -1362,7 +1362,7 @@ index 97fd19e..919cde7 100644
goto error;
}
@@ -2075,6 +2660,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2071,6 +2656,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
db_redis_key_free(&keys);
if (manual_keys)
pkg_free(manual_keys);
@ -1371,7 +1371,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
return 0;
@@ -2087,6 +2674,8 @@ error:
@@ -2083,6 +2670,8 @@ error:
db_redis_key_free(&keys);
if (manual_keys)
pkg_free(manual_keys);
@ -1380,7 +1380,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
return -1;
}
@@ -2109,6 +2698,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2105,6 +2694,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
km_redis_con_t *con = NULL;
int free_op = 0;
int do_table_scan = 0;
@ -1389,7 +1389,7 @@ index 97fd19e..919cde7 100644
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -2158,7 +2749,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2154,7 +2745,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
@ -1399,7 +1399,7 @@ index 97fd19e..919cde7 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2175,7 +2767,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2171,7 +2763,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_update(_h, con, _k, _v, query_ops, _uk, _uv, _n, _nu,
@ -1408,7 +1408,7 @@ index 97fd19e..919cde7 100644
goto error;
}
@@ -2189,6 +2781,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2185,6 +2777,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
if (manual_keys) {
pkg_free(manual_keys);
}
@ -1417,7 +1417,7 @@ index 97fd19e..919cde7 100644
db_redis_consume_replies(con);
return 0;
@@ -2201,6 +2795,8 @@ error:
@@ -2197,6 +2791,8 @@ error:
if (manual_keys) {
pkg_free(manual_keys);
}

@ -1,118 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 14 May 2020 10:41:06 +0200
Subject: [PATCH] jansson: use the core macros for ending string value with
'\0' and to restore
---
src/modules/jansson/jansson_funcs.c | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/modules/jansson/jansson_funcs.c b/src/modules/jansson/jansson_funcs.c
index 7eceae4..a5f8b1f 100644
--- a/src/modules/jansson/jansson_funcs.c
+++ b/src/modules/jansson/jansson_funcs.c
@@ -26,6 +26,7 @@
#include "../../core/mod_fix.h"
#include "../../core/lvalue.h"
+#include "../../core/str.h"
#include "jansson_path.h"
#include "jansson_funcs.h"
@@ -33,13 +34,13 @@
int janssonmod_get_helper(sip_msg_t* msg, str *path_s, str *src_s, pv_spec_t *dst_pv)
{
-
+ char c;
pv_value_t dst_val;
json_t* json = NULL;
json_error_t parsing_error;
-
+ STR_VTOZ(src_s->s[src_s->len], c);
json = json_loads(src_s->s, JSON_REJECT_DUPLICATES, &parsing_error);
-
+ STR_ZTOV(src_s->s[src_s->len], c);
if(!json) {
ERR("failed to parse json: %.*s\n", src_s->len, src_s->s);
ERR("json error at line %d, col %d: %s\n",
@@ -98,7 +99,7 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in,
str type_s;
str value_s;
str path_s;
-
+ char c;
pv_spec_t* result_pv;
pv_value_t result_val;
@@ -126,14 +127,11 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in,
result_val.rs.len = strlen("{}");
}
-/*
- ALERT("type is: %.*s\n", type_s.len, type_s.s);
- ALERT("path is: %.*s\n", path_s.len, path_s.s);
- ALERT("value is: %.*s\n", value_s.len, value_s.s);
- ALERT("result is: %.*s\n", result_val.rs.len, result_val.rs.s);
-*/
- char* result = result_val.rs.s;
+ LM_DBG("type is: %.*s\n", type_s.len, type_s.s);
+ LM_DBG("path is: %.*s\n", path_s.len, path_s.s);
+ LM_DBG("value is: %.*s\n", value_s.len, value_s.s);
+ LM_DBG("result is: %.*s\n", result_val.rs.len, result_val.rs.s);
json_t* result_json = NULL;
json_t* value = NULL;
@@ -143,14 +141,18 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in,
/* check the type */
if(STR_EQ_STATIC(type_s, "object") || STR_EQ_STATIC(type_s, "obj")){
+ STR_VTOZ(value_s.s[value_s.len], c);
value = json_loads(value_s.s, JSON_REJECT_DUPLICATES, &parsing_error);
+ STR_ZTOV(value_s.s[value_s.len], c);
if(value && !json_is_object(value)) {
ERR("value to add is not an object - \"%s\"\n", path_s.s);
goto fail;
}
}else if(STR_EQ_STATIC(type_s, "array")) {
+ STR_VTOZ(value_s.s[value_s.len], c);
value = json_loads(value_s.s, JSON_REJECT_DUPLICATES, &parsing_error);
+ STR_ZTOV(value_s.s[value_s.len], c);
if(value && !json_is_array(value)) {
ERR("value to add is not an array - \"%s\"\n", path_s.s);
goto fail;
@@ -211,9 +213,9 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in,
}
char* path = path_s.s;
-
- result_json = json_loads(result, JSON_REJECT_DUPLICATES, &parsing_error);
-
+ STR_VTOZ(result_val.rs.s[result_val.rs.len], c);
+ result_json = json_loads(result_val.rs.s, JSON_REJECT_DUPLICATES, &parsing_error);
+ STR_ZTOV(result_val.rs.s[result_val.rs.len], c);
if(!result_json) {
ERR("result has json error at line %d: %s\n",
parsing_error.line, parsing_error.text);
@@ -240,6 +242,7 @@ fail:
int janssonmod_array_size(struct sip_msg* msg, char* path_in, char* src_in, char* dst)
{
+ char c;
str src_s;
str path_s;
pv_spec_t *dst_pv;
@@ -259,9 +262,9 @@ int janssonmod_array_size(struct sip_msg* msg, char* path_in, char* src_in, char
json_t* json = NULL;
json_error_t parsing_error;
-
+ STR_VTOZ(src_s.s[src_s.len], c);
json = json_loads(src_s.s, JSON_REJECT_DUPLICATES, &parsing_error);
-
+ STR_ZTOV(src_s.s[src_s.len], c);
if(!json) {
ERR("json error at line %d: %s\n",
parsing_error.line, parsing_error.text);

@ -1,27 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 23 Sep 2020 09:01:43 +0200
Subject: [PATCH] ndb_redis: set message level to debug on exec
* logging error makes no sense here since there's going
to be a reconnection afterwards
> ERROR: ndb_redis [redis_client.c:903]: redisc_exec_argv(): Redis error: Server closed the connection
(cherry picked from commit a9c331d70dbed6827874aa99296203ac5a9d5c7b)
---
src/modules/ndb_redis/redis_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 5ad063f..bd97012 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -770,7 +770,7 @@ int redisc_exec_pipelined(redisc_server_t *rsrv)
/* null reply, reconnect and try again */
if (rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if (redisc_create_pipelined_message(rsrv) == 0)
{

@ -1,45 +0,0 @@
From 98805c723fbe01556e56d5b00ffc686b92014847 Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Fri, 27 Nov 2020 12:22:52 +0100
Subject: [PATCH] ndb_redis: set message level to debug on reconnect
* logging error makes no sense here since there's going
to be a reconnection afterwards
---
src/modules/ndb_redis/redis_client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 15a86f7b10..42880310f2 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -1011,7 +1011,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(redisc_reconnect_server(rsrv)==0)
{
@@ -1054,7 +1054,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(redisc_reconnect_server(rsrv)==0)
{
@@ -1152,7 +1152,7 @@ again:
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(res)
--
2.20.1

@ -8,10 +8,10 @@ Subject: pv_headers: fix $x_hdr index on get
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index ad5ba9d..3e0fcc0 100644
index 6aaa8ca..226be47 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -539,12 +539,12 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
@@ -538,12 +538,12 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
sr_xavp_t *xavi = NULL;
sr_xval_t *xval = NULL;
pv_value_t tv;
@ -28,7 +28,7 @@ index ad5ba9d..3e0fcc0 100644
if(param->pvn.type == PV_NAME_PVAR) {
if(pv_get_spec_value(msg, (pv_spec_p)(param->pvn.u.dname), &tv) != 0) {
LM_ERR("cannot get avp value\n");
@@ -553,24 +553,30 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
@@ -552,24 +552,30 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
if(!(tv.flags & PV_VAL_STR)) {
return pv_get_null(msg, param, res);
}

@ -151,7 +151,7 @@ index e0d4423..2decc79 100644
diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c
index c868e70..c09e168 100644
index 99361a5..7703e9c 100644
--- a/src/modules/tm/t_reply.c
+++ b/src/modules/tm/t_reply.c
@@ -695,6 +695,7 @@ typedef struct tm_faked_env {
@ -179,7 +179,7 @@ index c868e70..c09e168 100644
bind_address = _tm_faked_env[_tm_faked_env_idx].backup_si;
/* restore lump lists */
t->uas.request->add_rm
@@ -2211,6 +2215,7 @@ int reply_received( struct sip_msg *p_msg )
@@ -2214,6 +2218,7 @@ int reply_received( struct sip_msg *p_msg )
avp_list_t* backup_domain_from, *backup_domain_to;
avp_list_t* backup_uri_from, *backup_uri_to;
sr_xavp_t **backup_xavps;
@ -187,7 +187,7 @@ index c868e70..c09e168 100644
int replies_locked = 0;
#ifdef USE_DNS_FAILOVER
int branch_ret;
@@ -2400,6 +2405,7 @@ int reply_received( struct sip_msg *p_msg )
@@ -2403,6 +2408,7 @@ int reply_received( struct sip_msg *p_msg )
backup_domain_to = set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN,
&t->domain_avps_to );
backup_xavps = xavp_set_list(&t->xavps_list);
@ -195,7 +195,7 @@ index c868e70..c09e168 100644
setbflagsval(0, uac->branch_flags);
if(msg_status>last_uac_status) {
/* current response (msg) status is higher that the last received
@@ -2444,6 +2450,7 @@ int reply_received( struct sip_msg *p_msg )
@@ -2447,6 +2453,7 @@ int reply_received( struct sip_msg *p_msg )
set_avp_list( AVP_TRACK_FROM | AVP_CLASS_DOMAIN, backup_domain_from );
set_avp_list( AVP_TRACK_TO | AVP_CLASS_DOMAIN, backup_domain_to );
xavp_set_list(backup_xavps);

@ -23,7 +23,7 @@ Change-Id: Ic39a70e43004422e2b6e5db4788df68d9e223129
4 files changed, 252 insertions(+), 59 deletions(-)
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 489147a..1935fe3 100644
index 5ba8526..ee9fd0b 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -1154,7 +1154,7 @@ failure_route[1] {
@ -87,7 +87,7 @@ index 489147a..1935fe3 100644
<para>
Function returns 1 if loading of contacts succeeded or
diff --git a/src/modules/tm/t_serial.c b/src/modules/tm/t_serial.c
index 68b8afc..8592a9c 100644
index 8f7c492..7487c7c 100644
--- a/src/modules/tm/t_serial.c
+++ b/src/modules/tm/t_serial.c
@@ -33,6 +33,8 @@

Loading…
Cancel
Save