Module: kamailio
Branch: master
Commit: dc03199eaa7368003f3d2c188322e23d9c8512eb
URL:
https://github.com/kamailio/kamailio/commit/dc03199eaa7368003f3d2c188322e23…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-12-28T12:11:31+01:00
core: rename sdp parser USE_PKG_MEM and USE_SHM_MEM #define, prevent core mix-up
---
Modified: src/core/parser/sdp/sdp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/dc03199eaa7368003f3d2c188322e23…
Patch:
https://github.com/kamailio/kamailio/commit/dc03199eaa7368003f3d2c188322e23…
---
diff --git a/src/core/parser/sdp/sdp.c b/src/core/parser/sdp/sdp.c
index b4c9ffcaa3..7dbf259379 100644
--- a/src/core/parser/sdp/sdp.c
+++ b/src/core/parser/sdp/sdp.c
@@ -35,8 +35,8 @@
#include "sdp.h"
#include "sdp_helpr_funcs.h"
-#define USE_PKG_MEM 0
-#define USE_SHM_MEM 1
+#define SDP_USE_PKG_MEM 0
+#define SDP_USE_SHM_MEM 1
#define HOLD_IP_STR "0.0.0.0"
#define HOLD_IP_LEN 7
@@ -179,18 +179,18 @@ static inline sdp_payload_attr_t**
init_p_payload_attr(sdp_stream_cell_t* _strea
LM_ERR("Invalid number of payloads\n");
return NULL;
}
- if (pkg == USE_PKG_MEM) {
+ if (pkg == SDP_USE_PKG_MEM) {
_stream->p_payload_attr = (sdp_payload_attr_t**)pkg_malloc(payloads_num *
sizeof(sdp_payload_attr_t*));
- } else if (pkg == USE_SHM_MEM) {
+ } else if (pkg == SDP_USE_SHM_MEM) {
_stream->p_payload_attr = (sdp_payload_attr_t**)shm_malloc(payloads_num *
sizeof(sdp_payload_attr_t*));
} else {
LM_ERR("undefined memory type\n");
return NULL;
}
if (_stream->p_payload_attr == NULL) {
- if (pkg == USE_PKG_MEM) {
+ if (pkg == SDP_USE_PKG_MEM) {
PKG_MEM_ERROR;
- } else if (pkg == USE_SHM_MEM) {
+ } else if (pkg == SDP_USE_SHM_MEM) {
SHM_MEM_ERROR;
}
return NULL;
@@ -531,7 +531,7 @@ static int parse_sdp_session(str *sdp_body, int session_num, str
*cnt_disp, sdp_
}
/* Initialize fast access pointers */
- if (NULL == init_p_payload_attr(stream, USE_PKG_MEM)) {
+ if (NULL == init_p_payload_attr(stream, SDP_USE_PKG_MEM)) {
return -1;
}
parse_payload_attr = 1;
@@ -1082,7 +1082,7 @@ sdp_stream_cell_t * clone_sdp_stream_cell(sdp_stream_cell_t
*stream)
clone_stream->payloads_num = stream->payloads_num;
if (clone_stream->payloads_num) {
- if (NULL == init_p_payload_attr(clone_stream, USE_SHM_MEM)) {
+ if (NULL == init_p_payload_attr(clone_stream, SDP_USE_SHM_MEM)) {
goto error;
}
}
@@ -1319,3 +1319,5 @@ sdp_info_t * clone_sdp_info(struct sip_msg* _m)
return NULL;
}
+#undef SDP_USE_PKG_MEM
+#undef SDP_USE_SHM_MEM