You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2009/03/24 22:10:14 UTC
svn commit: r758024 - /incubator/thrift/trunk/lib/rb/ext/memory_buffer.c
Author: bryanduxbury
Date: Tue Mar 24 21:10:14 2009
New Revision: 758024
URL: http://svn.apache.org/viewvc?rev=758024&view=rev
Log:
THRIFT-402. rb: MemoryBuffer > 4096 bytes will truncate remaining bytes
This patch fixes the issue, preserving the remaining bytes.
Modified:
incubator/thrift/trunk/lib/rb/ext/memory_buffer.c
Modified: incubator/thrift/trunk/lib/rb/ext/memory_buffer.c
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/ext/memory_buffer.c?rev=758024&r1=758023&r2=758024&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/ext/memory_buffer.c (original)
+++ incubator/thrift/trunk/lib/rb/ext/memory_buffer.c Tue Mar 24 21:10:14 2009
@@ -49,7 +49,7 @@
index = RSTRING(buf)->len;
}
if (index >= GARBAGE_BUFFER_SIZE) {
- rb_ivar_set(self, buf_ivar_id, rb_funcall(buf, slice_method_id, 2, INT2FIX(index), INT2FIX(-1)));
+ rb_ivar_set(self, buf_ivar_id, rb_funcall(buf, slice_method_id, 2, INT2FIX(index), INT2FIX(RSTRING(buf)->len - 1)));
index = 0;
}