Change in ...osmo-mgw[master]: mgcp-cli: Support uppercase header parameters

pespin gerrit-no-reply at lists.osmocom.org
Wed Jun 26 10:23:31 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/14594


Change subject: mgcp-cli: Support uppercase header parameters
......................................................................

mgcp-cli: Support uppercase header parameters

MGCP RFC3435 (https://tools.ietf.org/html/rfc3435) states almost all
text has to be handled in a case-insensitive way, except SDP parts.

Related: OS#4001
Change-Id: I4f7b07b77c2946e9cd6f0eeca00011bd905126dd
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/94/14594/1

diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index f2204e1..fd188c3 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -35,6 +35,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
+#include <ctype.h>
 
 #ifndef OSMUX_CID_MAX
 #define OSMUX_CID_MAX 255 /* FIXME: use OSMUX_CID_MAX from libosmo-netif? */
@@ -573,7 +574,7 @@
 		*data_end = '\0';
 
 	for_each_non_empty_line(line, data_ptr) {
-		switch (line[0]) {
+		switch (toupper(line[0])) {
 		case 'Z':
 			rc = mgcp_parse_head_param(r->head.endpoint,
 						   sizeof(r->head.endpoint),
@@ -603,7 +604,6 @@
 				goto exit;
 			break;
 		case 'X':
-		case 'x':
 			if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
 				rc = mgcp_parse_osmux_cid(line);
 				if (rc < 0) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/14594
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4f7b07b77c2946e9cd6f0eeca00011bd905126dd
Gerrit-Change-Number: 14594
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190626/8f2d90a3/attachment.html>


More information about the gerrit-log mailing list