Module: kamailio
Branch: 5.4
Commit: 4669e8f295eefca64af61e168e5e79f540df89c8
URL:
https://github.com/kamailio/kamailio/commit/4669e8f295eefca64af61e168e5e79f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-09-23T09:19:52+02:00
imc: jump over printing error log messages when list commands are ok
- reported by GH #2481
(cherry picked from commit 92cfb5e8d291706889c926892397e663e2d93b05)
---
Modified: src/modules/imc/imc_cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4669e8f295eefca64af61e168e5e79f…
Patch:
https://github.com/kamailio/kamailio/commit/4669e8f295eefca64af61e168e5e79f…
---
diff --git a/src/modules/imc/imc_cmd.c b/src/modules/imc/imc_cmd.c
index 4ace0b800e..9dbc403e3e 100644
--- a/src/modules/imc/imc_cmd.c
+++ b/src/modules/imc/imc_cmd.c
@@ -942,13 +942,15 @@ int imc_handle_members(struct sip_msg* msg, imc_cmd_t *cmd,
struct imc_uri room;
memset(&room, '\0', sizeof(room));
- if (build_imc_uri(&room, cmd->param[0].s ? cmd->param[0] :
dst->parsed.user, &dst->parsed))
- goto error;
+ if (build_imc_uri(&room, cmd->param[0].s ? cmd->param[0] :
dst->parsed.user,
+ &dst->parsed)) {
+ goto done;
+ }
rm = imc_get_room(&room.parsed.user, &room.parsed.host);
if (rm == NULL || (rm->flags & IMC_ROOM_DELETED)) {
LM_ERR("Room [%.*s] does not exist!\n", STR_FMT(&room.uri));
- goto error;
+ goto done;
}
/* verify if the user is a member of the room */
@@ -956,7 +958,7 @@ int imc_handle_members(struct sip_msg* msg, imc_cmd_t *cmd,
if (member == NULL) {
LM_ERR("User [%.*s] is not member of room [%.*s]!\n",
STR_FMT(&src->uri), STR_FMT(&rm->uri));
- goto error;
+ goto done;
}
p = imc_body_buf;
@@ -1004,13 +1006,16 @@ int imc_handle_members(struct sip_msg* msg, imc_cmd_t *cmd,
body.len = p - body.s;
LM_DBG("members = '%.*s'\n", STR_FMT(&body));
- LM_ERR("Message-ID: '%.*s'\n", STR_FMT(get_callid(msg)));
+ LM_DBG("Message-ID: '%.*s'\n", STR_FMT(get_callid(msg)));
imc_send_message(&rm->uri, &member->uri, build_headers(msg), &body);
rv = 0;
+ goto done;
+
overrun:
LM_ERR("Buffer too small for member list message\n");
-error:
+
+done:
if (room.uri.s != NULL) pkg_free(room.uri.s);
if (rm != NULL) imc_release_room(rm);
return rv;
@@ -1065,7 +1070,8 @@ int imc_handle_rooms(struct sip_msg* msg, imc_cmd_t *cmd,
LM_DBG("rooms = '%.*s'\n", STR_FMT(&body));
imc_send_message(&dst->uri, &src->uri, build_headers(msg), &body);
- rv = 0;
+ return 0;
+
error:
LM_ERR("Buffer too small for member list message\n");
return rv;