[
https://jira.jboss.org/jira/browse/JGRP-1000?page=com.atlassian.jira.plug...
]
Dennis Reed commented on JGRP-1000:
-----------------------------------
That makes sense.
With your fix, the buffer size wouldn't have to change.
deflater.getTotalOut() returns the number of bytes written, so if the buffer was too
small, it's equal to the buffer size.
So it could be implemented with just:
+ if ( compressed_size < length ) {
byte[] new_payload=new byte[compressed_size];
System.arraycopy(compressed_payload, 0, new_payload, 0, compressed_size);
msg.setBuffer(new_payload);
msg.putHeader(name, new CompressHeader(length));
+ }
COMPRESS corrupts some messages
-------------------------------
Key: JGRP-1000
URL:
https://jira.jboss.org/jira/browse/JGRP-1000
Project: JGroups
Issue Type: Bug
Affects Versions: 2.4.5
Reporter: Dennis Reed
Assignee: Dennis Reed
Fix For: 2.4.7, 2.6.11, 2.8
COMPRESS.down() stores the compressed message in a temporary buffer the same size as the
original message.
If the compressed size of a message is larger than the original, then part of the message
is lost, with no errors reported.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira