[sr-dev] Re: [kamailio/kamailio] PKG Memory Leak with RTPEngine Module with WebSocket (Issue #3777)

2024-04-12 Thread vijaykumar-exotel via sr-dev
@miconda @henningw can you please review PR, after adding this fix, pkg memory 
is now getting available with this fix.
https://github.com/kamailio/kamailio/assets/115363081/f7548d0c-bc31-49bc-94d5-c86945e5b5df;>



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3777#issuecomment-2052521330
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] rtpengine: fix pkg mem leak in send_rtpp_command() (PR #3813)

2024-04-12 Thread vijaykumar-exotel via sr-dev
 Pre-Submission Checklist
!-- Go over all points below, and after creating the PR, tick all the 
checkboxes that apply --
!-- All points should be verified, otherwise, read the CONTRIBUTING 
guidelines from above--
!-- If youre unsure about any of these, dont hesitate to ask on 
sr-dev mailing list --
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:
!-- Go over all points below, and after creating the PR, tick the 
checkboxes that apply --
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3777
 Description
!-- Describe your changes in detail --
- freed request.s after sending request to websocket in send_rtpp_command 
method.

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3813

-- Commit Summary --

  * rtpengine: fix pkg mem leak in send_rtpp_command()

-- File Changes --

M src/modules/rtpengine/rtpengine.c (1)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3813.patch
https://github.com/kamailio/kamailio/pull/3813.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3813
You are receiving this because you are subscribed to this thread.

Message ID: kamailio/kamailio/pull/3...@github.com
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:a8481f58: nghttp2: debug message instead of error on peer disconnect

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: a8481f588d5461285e512a0b68803ffc0f41d7b3
URL: 
https://github.com/kamailio/kamailio/commit/a8481f588d5461285e512a0b68803ffc0f41d7b3

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: debug message instead of error on peer disconnect

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a8481f588d5461285e512a0b68803ffc0f41d7b3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a8481f588d5461285e512a0b68803ffc0f41d7b3.patch

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index d5153bef0c6..d8c23220a13 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -221,7 +221,7 @@ static void delete_http2_session_data(http2_session_data 
*session_data)
 {
http2_stream_data *stream_data;
SSL *ssl = bufferevent_openssl_get_ssl(session_data->bev);
-   LM_ERR("%s disconnected\n", session_data->client_addr);
+   LM_DBG("remote peer %s disconnected\n", session_data->client_addr);
if(ssl) {
SSL_shutdown(ssl);
}

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:11c5ed67: nghttp2: debug with data content

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 11c5ed679193c4cc94957c0a5948e07bfbfcfee9
URL: 
https://github.com/kamailio/kamailio/commit/11c5ed679193c4cc94957c0a5948e07bfbfcfee9

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: debug with data content

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/11c5ed679193c4cc94957c0a5948e07bfbfcfee9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/11c5ed679193c4cc94957c0a5948e07bfbfcfee9.patch

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 8c17f847f87..d5153bef0c6 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -560,6 +560,27 @@ static int on_frame_recv_callback(
return 0;
 }
 
+/*
+ * The implementation of nghttp2_on_data_chunk_recv_callback type.
+ * - function to get the received body.
+ */
+static int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
+   int32_t stream_id, const uint8_t *data, size_t len, void 
*user_data)
+{
+   struct Request *req;
+   (void)flags;
+   (void)user_data;
+
+   req = nghttp2_session_get_stream_user_data(session, stream_id);
+   if(req) {
+   LM_DBG(" (DATA chunk) [%lu 
bytes]\n",
+   (unsigned long int)len);
+   LM_DBG("[[%.*s]]", (int)len, (char *)data);
+   LM_DBG("\n");
+   }
+   return 0;
+}
+
 static int on_stream_close_callback(nghttp2_session *session, int32_t 
stream_id,
uint32_t error_code, void *user_data)
 {
@@ -587,6 +608,9 @@ static void initialize_nghttp2_session(http2_session_data 
*session_data)
nghttp2_session_callbacks_set_on_frame_recv_callback(
callbacks, on_frame_recv_callback);
 
+   nghttp2_session_callbacks_set_on_data_chunk_recv_callback(
+   callbacks, on_data_chunk_recv_callback);
+
nghttp2_session_callbacks_set_on_stream_close_callback(
callbacks, on_stream_close_callback);
 

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:702e9cdb: nghttp2: structure to hold headers in stream data

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce
URL: 
https://github.com/kamailio/kamailio/commit/702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: structure to hold headers in stream data

---

Modified: src/modules/nghttp2/nghttp2_server.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce.diff
Patch: 
https://github.com/kamailio/kamailio/commit/702e9cdbe8c6ca5856c25f9737d77e3223bbf9ce.patch

---

diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index cad3772d9ef..8b343fd11ce 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -66,12 +66,20 @@
 struct app_context;
 typedef struct app_context app_context;
 
+typedef struct http2_msghdr
+{
+   str name;
+   str value;
+   struct http2_msghdr *next;
+} http2_msghdr_t;
+
 typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
char *request_pathfull;
char *request_method;
+   ttp2_msghdr_t *hdrlist;
int32_t stream_id;
int fd;
 } http2_stream_data;

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:2b8d5877: nghttp2: added $nghttp2(pathfull) - full http path with all params

2024-04-12 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 2b8d587713d96fbee31534b9b16f2c2b432e2e68
URL: 
https://github.com/kamailio/kamailio/commit/2b8d587713d96fbee31534b9b16f2c2b432e2e68

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-12T21:59:44+02:00

nghttp2: added $nghttp2(pathfull) - full http path with all params

---

Modified: src/modules/nghttp2/nghttp2_mod.c
Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/2b8d587713d96fbee31534b9b16f2c2b432e2e68.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2b8d587713d96fbee31534b9b16f2c2b432e2e68.patch

---

diff --git a/src/modules/nghttp2/nghttp2_mod.c 
b/src/modules/nghttp2/nghttp2_mod.c
index 95918b1e6c8..c3e05e50b05 100644
--- a/src/modules/nghttp2/nghttp2_mod.c
+++ b/src/modules/nghttp2/nghttp2_mod.c
@@ -218,6 +218,14 @@ int pv_parse_nghttp2_name(pv_spec_p sp, str *in)
goto error;
}
break;
+   case 8:
+   if(strncasecmp(in->s, "pathfull", 8) == 0) {
+   sp->pvp.pvn.u.isname.name.n = 6;
+   } else {
+   goto error;
+   }
+   break;
+
default:
if(in->len > 2 && in->s[1] == ':'
&& (in->s[0] == 'h' || in->s[0] == 
'H')) {
@@ -275,6 +283,9 @@ int pv_get_nghttp2(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.srcip);
}
return pv_get_null(msg, param, res);
+   case 6: /* pathfull */
+   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.pathfull);
+
default:
return pv_get_null(msg, param, res);
}
diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index dec339d7a15..8c17f847f87 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -179,7 +179,12 @@ static void delete_http2_stream_data(http2_stream_data 
*stream_data)
close(stream_data->fd);
}
free(stream_data->request_path);
-   free(stream_data->request_method);
+   if(stream_data->request_pathfull) {
+   free(stream_data->request_pathfull);
+   }
+   if(stream_data->request_method) {
+   free(stream_data->request_method);
+   }
free(stream_data);
 }
 
@@ -460,6 +465,7 @@ static int on_header_callback(nghttp2_session *session,
for(j = 0; j < valuelen && value[j] != '?'; ++j)
;
stream_data->request_path = 
percent_decode(value, j);
+   stream_data->request_pathfull = 
percent_decode(value, valuelen);
} else if(namelen == sizeof(METHOD) - 1
  && memcmp(METHOD, name, namelen) == 
0) {
if(stream_data->request_method) {
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index 34e6155abfc..cad3772d9ef 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -70,6 +70,7 @@ typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
+   char *request_pathfull;
char *request_method;
int32_t stream_id;
int fd;
@@ -100,6 +101,7 @@ typedef struct ksr_nghttp2_ctx
int rplhdrs_n;
str method;
str path;
+   str pathfull;
str httpversion;
str data;
char srcipbuf[IP_ADDR_MAX_STR_SIZE];

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Less predictive algorithm for carrierroute hashing (Issue #3786)

2024-04-12 Thread Ben Kaufman via sr-dev
My guess is that md5 would be sufficient.  It's still odd feeling that CRC32 
wasn't getting sufficient randomization against the actual Call-Ids I was 
receiving.  Anything requiring OpenSSL and actual cryptographic-quality 
algorithms seems overkill, though.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3786#issuecomment-2051699184
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org