Module: kamailio
Branch: master
Commit: 7fb51562233c8b94a4bb38e4bcb8c7529937ed9e
URL:
https://github.com/kamailio/kamailio/commit/7fb51562233c8b94a4bb38e4bcb8c75…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-10T07:31:18+02:00
nghttp2: $nghttp2(url) replaced with $nghttp2(path)
- match corresponding http2 header name
---
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/7fb51562233c8b94a4bb38e4bcb8c75…
Patch:
https://github.com/kamailio/kamailio/commit/7fb51562233c8b94a4bb38e4bcb8c75…
---
diff --git a/src/modules/nghttp2/nghttp2_mod.c b/src/modules/nghttp2/nghttp2_mod.c
index de7a13485bf..95918b1e6c8 100644
--- a/src/modules/nghttp2/nghttp2_mod.c
+++ b/src/modules/nghttp2/nghttp2_mod.c
@@ -186,15 +186,10 @@ int pv_parse_nghttp2_name(pv_spec_p sp, str *in)
if(sp == NULL || in == NULL || in->len <= 0)
return -1;
switch(in->len) {
- case 3:
- if(strncasecmp(in->s, "url", 3) == 0) {
- sp->pvp.pvn.u.isname.name.n = 0;
- } else {
- goto error;
- }
- break;
case 4:
- if(strncasecmp(in->s, "data", 4) == 0) {
+ if(strncasecmp(in->s, "path", 4) == 0) {
+ sp->pvp.pvn.u.isname.name.n = 0;
+ } else if(strncasecmp(in->s, "data", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 1;
} else if(strncasecmp(in->s, "size", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 2;
@@ -264,8 +259,8 @@ int pv_get_nghttp2(sip_msg_t *msg, pv_param_t *param, pv_value_t
*res)
}
switch(param->pvn.u.isname.name.n) {
- case 0: /* url */
- return pv_get_strval(msg, param, res, &_ksr_nghttp2_ctx.url);
+ case 0: /* path */
+ return pv_get_strval(msg, param, res, &_ksr_nghttp2_ctx.path);
case 1: /* data */
return pv_get_strval(msg, param, res, &_ksr_nghttp2_ctx.data);
case 2: /* size */
diff --git a/src/modules/nghttp2/nghttp2_server.c b/src/modules/nghttp2/nghttp2_server.c
index 46b4e003462..38ae3673d46 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -494,8 +494,8 @@ static int on_request_recv(nghttp2_session *session,
_ksr_nghttp2_ctx.session_data = session_data;
_ksr_nghttp2_ctx.stream_data = stream_data;
- _ksr_nghttp2_ctx.url.s = stream_data->request_path;
- _ksr_nghttp2_ctx.url.len = strlen(_ksr_nghttp2_ctx.url.s);
+ _ksr_nghttp2_ctx.path.s = stream_data->request_path;
+ _ksr_nghttp2_ctx.path.len = strlen(_ksr_nghttp2_ctx.path.s);
_ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
_ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
diff --git a/src/modules/nghttp2/nghttp2_server.h b/src/modules/nghttp2/nghttp2_server.h
index dc1f5f148c6..bb5e446631c 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -98,7 +98,7 @@ typedef struct ksr_nghttp2_ctx
nghttp2_nv rplhdrs_v[KSR_NGHTTP2_RPLHDRS_SIZE];
int rplhdrs_n;
str method;
- str url;
+ str path;
str httpversion;
str data;
char srcipbuf[IP_ADDR_MAX_STR_SIZE];