Commit Graph

36 Commits

Author SHA1 Message Date
Roger Meier
472f9e190c THRIFT-1252 Segfault in Ruby deserializer
Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1153093 13f79535-47bb-0310-9956-ffa450edef68
2011-08-02 10:55:47 +00:00
Bryan Duxbury
ad0ad824d2 THRIFT-1189. rb: Ruby deserializer speed improvements
This patch gives the Ruby deserialization stack a healthy performance boost.

Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1140780 13f79535-47bb-0310-9956-ffa450edef68
2011-06-28 18:46:03 +00:00
Bryan Duxbury
d1df20a20d THRIFT-418. rb: Don't do runtime sorting of struct fields
A simpler version of the already-committed patch.

Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1136189 13f79535-47bb-0310-9956-ffa450edef68
2011-06-15 20:52:57 +00:00
Bryan Duxbury
df8a0e6fca THRIFT-418. rb: Don't do runtime sorting of struct fields
Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1134122 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 22:46:28 +00:00
Bryan Duxbury
911d2f1576 THRIFT-1182. rb: Native deserializer segfaults on incorrect list element type
This patch causes both the pure ruby and native extension code paths to check if the data in lists, sets, and maps is of the expected type before deserlizing it. When it's not the right type, it now skips the bad data correctly.

Patch: Ilya Maykov

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1129892 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 20:03:29 +00:00
Bryan Duxbury
c3affb3940 THRIFT-979. rb: ruby bindings used to work on jruby
Make a dummy makefile so that JRuby doesn't complain.

Patch: Jeff Hodges

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1036267 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17 22:47:06 +00:00
Bryan Duxbury
09d13c2edf THRIFT-664. rb: Ruby extension fails to build with Ruby 1.9.1
This change takes care of the 1.9 build issues and a few other c-extension niceties.

Patch: Rajesh Malepati

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984524 13f79535-47bb-0310-9956-ffa450edef68
2010-08-11 18:37:25 +00:00
Bryan Duxbury
d2cc5bb39e THRIFT-699. rb: Excise unused 'native protocol method table' stuff from thrift_native
The code was completely unused and superfluous, and now it's gone.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980209 13f79535-47bb-0310-9956-ffa450edef68
2010-07-28 21:00:06 +00:00
Bryan Duxbury
65073e5b11 add newline to the end of struct.c to make some whiney compilers happy
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@915398 13f79535-47bb-0310-9956-ffa450edef68
2010-02-23 15:46:46 +00:00
Bryan Duxbury
33e190cd15 THRIFT-697. Union support in Ruby
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@910700 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 21:19:01 +00:00
Bryan Duxbury
35565a4719 THRIFT-671. rb: Ruby compact protocol implementation gets mixed up when there are fields that don't fit in the delta space
This patch adds a test and a fix for the problem.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@896712 13f79535-47bb-0310-9956-ffa450edef68
2010-01-06 23:12:09 +00:00
Bryan Duxbury
834895d15c THRIFT-603. rb: Struct read method does not call validate
After reading a struct, we will now call the struct's validate method.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@825369 13f79535-47bb-0310-9956-ffa450edef68
2009-10-15 01:20:34 +00:00
Bryan Duxbury
3647fc62f5 THRIFT-569. rb: Segmentation Fault when using BinaryProtocolAccelerated in Ruby
This patch checks to make sure that a value is a string before treating it as one. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810689 13f79535-47bb-0310-9956-ffa450edef68
2009-09-02 20:05:07 +00:00
Bryan Duxbury
6f6318a652 THRIFT-572. rb: fix RSTRING for 1.9 compatibility
Use a macro compatible with Ruby 1.9.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810303 13f79535-47bb-0310-9956-ffa450edef68
2009-09-01 23:18:34 +00:00
Bryan Duxbury
fd58c55dca THRIFT-571. rb: compact_protocol.c:89: warning: format not a string literal and no format arguments
This patch solves the issue for those of you on Ruby 1.9.1.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810288 13f79535-47bb-0310-9956-ffa450edef68
2009-09-01 22:32:50 +00:00
Bryan Duxbury
293086cacc THRIFT-547. rb: Thrift deserializer hangs when deserializing empty string
Thrift::MemoryBuffer will now throw an EOFError when it cannot fulfill a request for data. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799696 13f79535-47bb-0310-9956-ffa450edef68
2009-07-31 18:53:14 +00:00
Bryan Duxbury
ccae884739 THRIFT-498. rb: Compact and Binary native protocols, used at the same time, can cause some issues
Disable native method table usage.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799693 13f79535-47bb-0310-9956-ffa450edef68
2009-07-31 18:47:09 +00:00
Bryan Duxbury
d1d1542e1e THRIFT-276. rb: Ruby libraries should have one class per file
This monster of a patch moves all the classes into their own files and specs as appropriate. Additionally, it concentrates all the requires into thrift.rb, removing the need to require any other file. (Changes were made to the compiler to reflect this reduced requirement.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761849 13f79535-47bb-0310-9956-ffa450edef68
2009-04-04 00:58:03 +00:00
Bryan Duxbury
5b8b484548 THRIFT-417. rb: BufferedTransport can enter an infinite loop
Switch native proto implementations to use read_all instead of read. Add a bunch of tests to verify. 

Also:
- removed some commented code in binary_protocol_accelerated.c
- struct.c was missing one of the possible native method calls
- updates gem manifest (included files that didn't exist)
- fixed svn:ignores of test/rb/gen-rb and lib/java/gen-java

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761037 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 20:10:15 +00:00
Bryan Duxbury
ac002d32a7 THRIFT-415. rb: BinaryProtocolAccelerated does not behave properly when strict reads are turned off
This patch adds the appropriate test for the behavior and fixes the thrift_native project to do the right thing. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760735 13f79535-47bb-0310-9956-ffa450edef68
2009-03-31 23:48:36 +00:00
David Reiss
ea2cba8ba8 THRIFT-387. Add license headers to a bunch of files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760189 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 21:35:00 +00:00
Bryan Duxbury
ea0d126f32 Needed a newline at the end of the file to avoid warnings when compiling on linux.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760183 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 21:24:34 +00:00
Bryan Duxbury
72737e4c96 Need a newline at the end of the file for it to compile.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760143 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:11:45 +00:00
Bryan Duxbury
6b771d2c62 THRIFT-408. rb: Ruby C extension doesn't build on 1.8.5
This patch redefines the important macros so 1.8.5 is compatible.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758517 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 04:55:34 +00:00
Bryan Duxbury
e3ab50d0f3 THRIFT-374. rb: ruby 1.9 compatibility
This patch updates the thrift_native package to use 1.9 compatible macros and fixes the pure ruby stuff to behave equally well in ruby1.8.6-ruby1.9.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758435 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 21:06:53 +00:00
Bryan Duxbury
2f20ae45fb THRIFT-402. rb: MemoryBuffer > 4096 bytes will truncate remaining bytes
This patch fixes the issue, preserving the remaining bytes.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758024 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 21:10:14 +00:00
Kevin Clark
916f353f9f Add Apache headers to Ruby libs and remove a few remaining Facebook notices
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756322 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 04:21:39 +00:00
Bryan Duxbury
d40731edb2 THRIFT-313. rb: BinaryProtocolAccelerated and BinaryProtocol don't produce the same bytes when writes aren't strict
A Fixnum was not properly being converted to its native value before being written. This patch rectifies that problem.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756308 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 02:21:05 +00:00
Bryan Duxbury
d815c218c8 THRIFT-332. rb: Compact Protocol in Ruby
This patch includes both a pure Ruby and C-extension port of the Compact Protocol described in THRIFT-110. It also fixes a bug in struct.c that was interfering with native protocol method calls, and adds some utility classes to the Java library for serializing/deserializing to a file for the purpose of testing protocols cross-language.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756133 13f79535-47bb-0310-9956-ffa450edef68
2009-03-19 18:57:43 +00:00
Kevin Clark
ead3382915 THRIFT-254. rb: Add optional strict version support to binary protocols
Author: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740930 13f79535-47bb-0310-9956-ffa450edef68
2009-02-04 22:43:59 +00:00
Bryan Duxbury
1e80d4465a THRIFT-302. ruby: Native extension fails to build
A piece of code needed for compilation on Linux was missing; this patch replaces it. Also, there were some compiler warnings and declarations that were missing that are now fixed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740366 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 18:16:54 +00:00
Bryan Duxbury
c016628a8a THRIFT-248. ruby: Factor BinaryProtocolAccelerated into separate protocol and struct components
This patch replaces the "binaryprotocolaccelerated" c extension with the "thrift_native" c extension. This new extension creates native implementations for the struct.rb #write and #read methods, Thrift::BinaryProtocol, and Thrift::MemoryBuffer, but keeps ruby-level interfaces, allowing all protocols to benefit from the struct code and the memory buffer. There is however an additional cost associated with going through this ruby layer, but the increased interoperability seems to be well worth it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739895 13f79535-47bb-0310-9956-ffa450edef68
2009-02-02 00:48:17 +00:00
Kevin Clark
14fe791ef3 Merge branch 'THRIFT-103'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@682458 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 18:46:19 +00:00
David Reiss
0c7d38cf83 rb: Teach BinaryProtocolAccelerated to encode strings with NULs [THRIFT-97]
This patch adds a spec and fixes the behavior to properly treat strings as binary
blobs of data instead of as C strings when writing to the transport.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679899 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 21:06:06 +00:00
David Reiss
3899248d29 rb: BinaryProtocolAccelerated should use Thrift::ProtocolException [THRIFT-89]
BinaryProtocolAccelerated references the deprecated name TProtocolException,
when it should be using Thrift::ProtocolException.
It also uses rb_raise() instead of rb_exc_raise().


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679897 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 21:05:59 +00:00
Kevin Clark
4bd8916b12 Merge branch 'fastbinary'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 00:47:49 +00:00