From fe53318ef472eed97f573755d50a5b97f9db2e20 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 24 Apr 2019 17:52:58 +0800 Subject: [PATCH] FS-11721 fix send empty message A request with no body MUST NOT include a Content-Type or any other MIME-specific header fields. A request without a body MUST contain an end-line after the final header field. No extra CRLF will be present between the header section and the end-line. --- src/switch_msrp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switch_msrp.c b/src/switch_msrp.c index 3da793e426..f800caad76 100644 --- a/src/switch_msrp.c +++ b/src/switch_msrp.c @@ -1538,10 +1538,12 @@ static switch_status_t switch_msrp_do_send(switch_msrp_session_t *ms, switch_msr } memcpy(buf + len, msrp_msg->payload, msrp_msg->payload_bytes); len += msrp_msg->payload_bytes; + sprintf(buf + len, "\r\n"); + len += 2; } - sprintf(buf + len, "\r\n-------%s$\r\n", transaction_id); - len += (12 + strlen(transaction_id)); + sprintf(buf + len, "-------%s$\r\n", transaction_id); + len += (10 + strlen(transaction_id)); if (globals.debug) dump_buffer(buf, len, __LINE__, 1);