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
master
Vitaliy Filippov 2015-08-18 12:08:09 +03:00
parent 618d2bd4d4
commit acf43f619f
1 changed files with 2 additions and 0 deletions

View File

@ -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);