Hi
Using kamailio with http jsonrpcs
found next trouble
When i making request like
curl -s -H 'Content-Type: application/json' --data-binary '{"method":"htable.get","params":{**"name":"mytable"**,"key":"myparam"},"jsonrpc":"2.0"}' http://127.0.0.1:5060/jsonrpc
all fine. I getting good response
But when I making
curl -s -H 'Content-Type: application/json' --data-binary '{"method":"htable.get","params":{"key":"myparam",**"name":"mytable"**},"jsonrpc":"2.0"}' http://127.0.0.1:5060/jsonrpc
i.e keys of object on different places
It gives me
curl -s -H 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0", "method": "htable.get","params":{"key":"mykey","name": "mytable"}}' http://127.0.0.1:5060/jsonrpc
{
"jsonrpc": "2.0",
"error": {
"code": 500,
"message": "No such htable"
}
}
Means kamailio cant find needed htable
I supposed that position of the key should't have a matter for the JSON objects parsers
But here is looks like different
May be it is not a bug bug feature request because of it is just an unexpected behaivor
Im using kamailio 5.1.3 on the Debian 9
version: kamailio 5.1.3 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 00:25:48 May 9 2018 with gcc 6.3.0
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1550
Module: kamailio
Branch: master
Commit: 7e08fc8d2b74657d6e6171effbab2770482d693e
URL: https://github.com/kamailio/kamailio/commit/7e08fc8d2b74657d6e6171effbab277…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-05-29T13:29:36+02:00
stun: catch udp ping 0000 when trying to parse stun headers
- avoid useless debug message
- info message made debug if the size of received packet is too small
for a stun header
---
Modified: src/modules/stun/kam_stun.c
---
Diff: https://github.com/kamailio/kamailio/commit/7e08fc8d2b74657d6e6171effbab277…
Patch: https://github.com/kamailio/kamailio/commit/7e08fc8d2b74657d6e6171effbab277…
---
diff --git a/src/modules/stun/kam_stun.c b/src/modules/stun/kam_stun.c
index 350317b0e7..62bd368589 100644
--- a/src/modules/stun/kam_stun.c
+++ b/src/modules/stun/kam_stun.c
@@ -165,8 +165,12 @@ static int stun_parse_header(struct stun_msg* req, USHORT_T* error_code)
{
if (sizeof(req->hdr) > req->msg.buf.len) {
+ if(req->msg.buf.len==4 && *((int*)req->msg.buf.s)==0) {
+ /* likely the UDP ping 0000 */
+ return FATAL_ERROR;
+ }
/* the received message does not contain whole header */
- LOG(L_INFO, "INFO: stun_parse_header: incomplete header of STUN message\n");
+ LM_DBG("incomplete header of STUN message\n");
/* Any better solution? IMHO it's not possible to send error response
* because the transaction ID is not available.
*/
### Description
We need to connect to a cluster of mongodb hosts with some specific parameters.
The connection string has length more than 255 characters.
We could not connect to our mongodb.
### Troubleshooting
#### Reproduction
Use very long string for example like bellow
mongo0-pdb-demo.somedomain.com:27017,mongo1-pdb-demo.somedomain.com:27017,mongo2-pdb-demo.somedomain.com:27017/proxy-db-ft1?replicaSet=rs0&ssl=true&sslClientCertificateKeyFile=/etc/ssl/domain1234.pem&sslCertificateAuthorityFile=/etc/ssl/godaddy.pem
#### Log Messages
We got errors:
ERROR: <core> [db.c:168]: db_bind_mod(): SQL URL too long
ERROR: auth_db [auth_db_mod.c:173]: mod_init(): unable to bind to a database driver
### Additional Information
version: kamailio 4.4.7 (x86_64/linux)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1545
Module: kamailio
Branch: master
Commit: 0a9ebbbdfe0cd4c137338adbacf5c5890222708a
URL: https://github.com/kamailio/kamailio/commit/0a9ebbbdfe0cd4c137338adbacf5c58…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-05-28T15:34:29+02:00
lib/srdb1: increased the safety check for max db url to 1023
- was 255, too small for large connection strings needed for no-sql
- reported by GH #1545
---
Modified: src/lib/srdb1/db.c
---
Diff: https://github.com/kamailio/kamailio/commit/0a9ebbbdfe0cd4c137338adbacf5c58…
Patch: https://github.com/kamailio/kamailio/commit/0a9ebbbdfe0cd4c137338adbacf5c58…
---
diff --git a/src/lib/srdb1/db.c b/src/lib/srdb1/db.c
index c3908af85d..305543c931 100644
--- a/src/lib/srdb1/db.c
+++ b/src/lib/srdb1/db.c
@@ -60,7 +60,7 @@
#include "db_query.h"
#include "db.h"
-static unsigned int MAX_URL_LENGTH = 255; /*!< maximum length of a SQL URL */
+static unsigned int MAX_URL_LENGTH = 1023; /*!< maximum length of a SQL URL */
int db_check_api(db_func_t* dbf, char *mname)