]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11721 fix send empty message
authorSeven Du <dujinfang@x-y-t.cn>
Wed, 24 Apr 2019 09:52:58 +0000 (17:52 +0800)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 19:26:12 +0000 (23:26 +0400)
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

index 3da793e426514479025ed66921b02e7c878d7a52..f800caad7653e465e5eb988ff5692d7b0dcff23a 100644 (file)
@@ -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);