mgcp-cli: Support lowercase 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
This commit is contained in:
parent
0c6c3c1da6
commit
166077ea48
|
@ -35,6 +35,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifndef OSMUX_CID_MAX
|
#ifndef OSMUX_CID_MAX
|
||||||
#define OSMUX_CID_MAX 255 /* FIXME: use OSMUX_CID_MAX from libosmo-netif? */
|
#define OSMUX_CID_MAX 255 /* FIXME: use OSMUX_CID_MAX from libosmo-netif? */
|
||||||
|
@ -573,7 +574,7 @@ static int parse_head_params(struct mgcp_response *r)
|
||||||
*data_end = '\0';
|
*data_end = '\0';
|
||||||
|
|
||||||
for_each_non_empty_line(line, data_ptr) {
|
for_each_non_empty_line(line, data_ptr) {
|
||||||
switch (line[0]) {
|
switch (toupper(line[0])) {
|
||||||
case 'Z':
|
case 'Z':
|
||||||
rc = mgcp_parse_head_param(r->head.endpoint,
|
rc = mgcp_parse_head_param(r->head.endpoint,
|
||||||
sizeof(r->head.endpoint),
|
sizeof(r->head.endpoint),
|
||||||
|
@ -603,7 +604,6 @@ static int parse_head_params(struct mgcp_response *r)
|
||||||
goto exit;
|
goto exit;
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
case 'x':
|
|
||||||
if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||||
rc = mgcp_parse_osmux_cid(line);
|
rc = mgcp_parse_osmux_cid(line);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
Loading…
Reference in New Issue