From acf43f619f177eb2370d24f84319a66c4a1a3cc6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 18 Aug 2015 12:08:09 +0300 Subject: [PATCH] Only add content-length header for messages containing zero byte Allows OpenMQ/ActiveMQ to correctly map messages to JMS TextMessages instead of only BytesMessages. Fixes https://bugs.php.net/bug.php?id=70280 --- php_stomp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/php_stomp.c b/php_stomp.c index 9012059..0536b76 100644 --- a/php_stomp.c +++ b/php_stomp.c @@ -747,6 +747,8 @@ PHP_FUNCTION(stomp_send) CLEAR_FRAME(frame); RETURN_FALSE; } + if (frame.body_length > 0 && strnlen(frame.body, frame.body_length) >= frame.body_length) + frame.body_length = 0; if (stomp_send(stomp, &frame TSRMLS_CC) > 0) { success = stomp_valid_receipt(stomp, &frame);