Commit Graph

686 Commits

Author SHA1 Message Date
David Reiss
c16a8f6e45 Thrift: Python support for Unix-domain sockets, and eager timeout setting.
Reviewed By: mcslee

Test Plan: Ran the test script.

Revert Plan: ok

Other Notes:
Contributed by Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665394 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 23:46:47 +00:00
David Reiss
4a15eb7f71 Thrift: Maximum read length for Java.
Summary:
A feature to improve handling of invalid wire data by the Java Thrift library.

Reviewed By: mcslee

Test Plan: I trust Dave Engberg.

Revert Plan: ok

Other Notes:
Submitted by Dave Engberg.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665393 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 22:14:47 +00:00
David Reiss
adad4ab203 Thrift: Fix dangling pointer errors and make messages a bit more uniform.
Reviewed By: mcslee

Test Plan: Honestly, just built the library.

Revert Plan: ok

Other Notes:
Thanks to Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665392 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 20:56:04 +00:00
David Reiss
15457c9b08 Thrift: Smalltalk prefix support.
Reviewed By: mcslee

Test Plan: Built the compiler.

Revert Plan: ok

Other Notes:
Contributed by Ben Matasar.
Signed off by Patrick Collison.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665391 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 07:03:03 +00:00
Mark Slee
77a31384b8 Use HAVE_SYS_TIME_H instead of HAVE_CLOCK_GETTIME
Summary: Still need the right include here

Reviewed By: mcslee

Test Plan: Paul Saab used this fix to build on Leopard


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665390 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 22:47:33 +00:00
pfung
78ee85c911 [Thrift] message debugging for std::exceptions
std::exceptions did not have debug messages printed

reviewed by dreiss
test plan: compiles


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665389 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 22:30:47 +00:00
James Wang
ae3804f8f7 Fix to TThriftTransport corruption detection
Summary: O_APPEND means that even if the file pointer is in the middle of the file, the next write will go to the end of the file. So when initializing the TThriftTransport to be written to, we need to truncate the file after the last good event.  I'm pretty sure this was what was causing queuemap log corruption when the multiplexer is restarted.

         The corruption doesn't necessarily go away at the next chunk boundary because of the offset being recalculated.  I think it's good to have the offset recalculated, but then we shouldn't use the old chunk boundary data there, but rather use the newly calculated offset to determine the padding (could be an entire chunk, but that's okay -- way better than corruption)

Reviewed By: mcslee

Test Plan: Wrote to a ThriftFile using local scribe instance. Printed it. Then cat'd garbage to it from the command line. Then wrote to it again. Then printed it again.  Seems to work fine, whereas with old scribe binary the later entries were corrupted.

Revert: OK

DiffCamp Revision: 4683


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665388 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 19:46:27 +00:00
Aditya Agarwal
c31769cceb -- better error checking for setRecvTimeout and setSendTimeout
Summary:
- could help prevent a 2.6.13 kernel bug

Reviewed By: mcslee, dreiss

Test Plan:
- Testing kernel crashes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665387 13f79535-47bb-0310-9956-ffa450edef68
2007-12-11 22:23:51 +00:00
Mark Slee
5d1784a7b4 Failing to init eventBase_ to NULL in one constructor
Reviewed By: dreiss

Test Plan: See if scribe works for powerset


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665386 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:20:54 +00:00
Mark Slee
3f14d3ebec Merge Ruby framed transport
Summary: Submitted by Jake Luciani

Reviewed By: mcslee

Test Plan: Test code included in this commit


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665385 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:13:11 +00:00
Mark Slee
c37b4c5193 Remove unnecessary mutex from C++ socket code
Summary: This is a threadsafe syscall, as it turns out.

Reviewed By: hzhao

Test Plan: Thrift Client C++ sockets don't lock


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665384 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:03:37 +00:00
dweatherford
2323cf6422 [thrift] Better default TApplicationException messages
Summary: "Default TApplicationException" is pretty meaningless; if we have this
  extra type information, we might as well present it.

Reviewed By: mcslee
Test Plan: caught a couple of INVALID_MESSAGE_TYPE tapplicationexceptions
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665383 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 03:40:19 +00:00
David Reiss
ef22dc652f Thrift: Make some server methods public.
Reviewed By: mcslee

Test Plan: Compiles.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665382 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 20:38:49 +00:00
Mark Slee
9860ee2c86 Fix bug that double-initializes list objects in deserialization.
Reviewed By: jssarma

Test Plan: Regenerate Java code, check list deserializer for no double-object instantiation


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665381 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 01:43:36 +00:00
Mark Slee
f60467efc9 Custom HTTP headers patch from Dave Engberg
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665380 13f79535-47bb-0310-9956-ffa450edef68
2007-11-29 02:57:34 +00:00
Mark Slee
6f9ac3ffeb Thrift compiler now enforces uniqueness of field identifiers
Summary: The code would either not generate, or generate code with errors, if you did this beforehand. Now it's a die-fast stop hard error since this is absolultely always a wrong thing to do.

Reviewed By: dreiss

Test Plan: Test compiling a .thrift file with a repeated field identifier in a struct or arglist.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665379 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 22:28:13 +00:00
David Reiss
bef54c0647 Thrift: Fix a backwards change.
Summary:
Got it right in trunk, but wrong in thrift.

Blame Rev: 69504

Reviewed By: mcslee

Test Plan:
Tested in trunk AND did a diff with trunk.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665378 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 20:15:11 +00:00
Mark Slee
b16074d53b Add pkgconfig to Thrift C++ libraries
Reviewed By: mcslee

Other Notes: Submitted by Ben Maurer


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665377 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 05:54:33 +00:00
Mark Slee
d0f5b28835 Fix typo in Thrift trunk
Summary: $classl => $class


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665376 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 04:29:25 +00:00
Mark Slee
e02ab33cb8 Lowercase autoload strings
Summary: PHP is undebatably the worst programming language in the world. Class names are case insensitive, so new $tHiNg = new $THing. Garbase. Now autoload has to deal with the fallout.

Reviewed By: dreiss

Test Plan: autoload enabled falcon code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665375 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 04:17:49 +00:00
Mark Slee
645ecea714 Kill fast binary compliance in TBase, it doesn't work
Reviewed By: akhil

Test Plan: Regenerate code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665374 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:46:24 +00:00
Mark Slee
d602f822d5 Complete the proper handling of all special characters in JSON strings for TJSONProtocol
Reviewed By: dreiss

Test Plan: test/java/TestClient


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665373 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:45:13 +00:00
Mark Slee
b22df7c963 Make inheriting from TBase and using inherited read method optional in generated Thrift PHP code
Reviewed By: dreiss, akhil

Test Plan: Generate falcon etc. without -phpo and check it out


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665372 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:39:59 +00:00
Mark Slee
b4d3e7b052 Create a TServerEventHandler interface in TServer
Summary: Such that users can supply an event handler to a server that will be used to signal various events that take place inside the server core.

Reviewed By: dreiss

Test Plan: Rebuilt all servers, work by default

Other Notes: Partially submitted and also reviewed by Dave Simpson at Powerset


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665371 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 01:51:43 +00:00
Mark Slee
b455292699 Add a few utility methods and helpers to Thrift C++ Sockets
Summary: Submitted by Dave Simpson @ Powerset.

Reviewed By: mcslee

Test Plan: test/cpp


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665370 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 00:12:11 +00:00
Mark Slee
fe6ed0dff4 Clean up the TSerializer
Summary: Nested Transport subclass wasn't necessary, add comments

Reviewed By: dreiss

Test Plan: Same as before, test/java/TestClient


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665369 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 21:54:38 +00:00
Mark Slee
256bdc4448 IPv6 tweaks for Thrift
Summary: Need to pass hints including AI_ADDRCONFIG to getaddrinfo to make sure no IPv6 addresses come back on non-IPv6 enabled systems

Reviewed By: mcslee

Other Notes: Submitted by Paul Saab


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665368 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:42:19 +00:00
Mark Slee
844ac12489 TJSONProtocol writing support in Java
Summary: TJSONProtocol for Java with write support and a TSerializer utility for easier conversion of Thrift objects into byte[] or strings.

Reviewed By: dreiss

Test Plan: Included a basic piece of this in test/ client for Java.

Revert: OK

DiffCamp Revision: 3890


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665367 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:38:52 +00:00
Mark Slee
5ab570558f Fix writeContainerEnd call being inside loop instead of after loop
Summary: Potentailly breaks Java serialization for protocols that care about container termination.

Reviewed By: dreiss

Test Plan: Generate code, veirfy writeListEnd/writeSetEnd is in the apporpriate place


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665366 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:38:16 +00:00
Mark Slee
53d9c0c20b Merging EOFException changes from Ben Maurer
Summary: Throw a proper EOFError in this case. Long term we want to change this to properly fit into the Thrift TException heirarchy with a good way to handle the original exception as well. For now, Ben is the primary user of this so we'll go ahead with his patch.

Reviewed By: mcslee

Test Plan: Included in test/py/TestEof.py


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665365 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 21:15:40 +00:00
Mark Slee
79b1694043 Refactor TNonblockingServer to use event_base construct
Summary: This allows the event loop to be shared across different components of a program of for a separate thread in a TNonblockingServer to safely use its own libevent code without conflicts.

Reviewed By: mcslee

Test Plan: Updated test/ committed here

Other Notes: submitted by Ben Maurer, patched in by mcslee with slight modifications


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665364 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 19:05:29 +00:00
Mark Slee
7962223ce2 libtoolize and configure tweaks for Thrift compiler
Summary: Need glibtoolize on OSX.

Reviewed By: mcslee

Other Notes: From Paul Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665363 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 23:35:52 +00:00
Mark Slee
a9387af56e Double-free Cocoa fix: Redux
Summary: Need get_true_type to evaluate string status

Reviewed By: mcslee

Other Notes: Submission from Andrew McGeachie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665362 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 22:05:50 +00:00
Mark Slee
bd5882259d Merging in some Smalltalk changes from Patrick Collison
Reviewed By: mcslee

Test Plan: Rebuild Thrift compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665361 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 08:43:35 +00:00
Mark Slee
12a28758a6 Fix cocoa double-free issue with strings
Reviewed By: mcslee

Other Notes: Submitted by Andrew McGeachie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665360 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 23:55:33 +00:00
Mark Slee
8067485595 Complete rb test server with testEnum and testTypedef
Reviewed by: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665359 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 05:54:13 +00:00
Mark Slee
efd37f14d2 Add Smalltalk support to Thrift
Summary: Submitted by Patrick Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665358 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 05:13:09 +00:00
Mark Slee
a1d4cab45f Make Java TBinaryProtocol default to strictWrite
Summary: About time we did this. Breaks the test suite's defaults


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665357 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 04:58:16 +00:00
Mark Slee
276eea68b7 Add (int) case to Thrift version comparison
Summary: Deals with 32 bit machines doing a weird sign-bit thing here.

Reviewed By: dreiss

Test Plan: For 32 bit AmieStreet partners


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665356 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 02:06:47 +00:00
Mark Slee
12a3b4e002 Do not generate constants php files from Thrift when they will be empty
Summary: That's just silly

Reviewed By: peter, dreiss

Test Plan: Generate PHP from a .thrift with no constants. Notice there is no _constants.php generated.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665355 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 02:05:29 +00:00
Mark Slee
8440605c27 Cocoa Thrift binding patches from Andrew McGeachie
Summary: Latest updates to the Cocoa bindings


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665354 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 01:39:25 +00:00
Mark Slee
fb4b514028 IPv6 support for the TNonBlockingServer
Summary: Need to use IPv6 compliant constructs here. Submitted by Paul Saab.

Reviewed By: dreiss

Test Plan: Rebuild Thrift TNonblockingServer with this patch and verify behaves just the same


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665353 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 01:27:08 +00:00
hzhao
b6014f494f added trunk
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665352 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:54:30 +00:00
hzhao
7fcc9e87ba tagging thrift-protocol-1.0.0
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665351 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:48:56 +00:00
Christopher Piro
de11d85211 [thrift] gut Erlang exception handling
Summary: * move type field to tException from subclasses
          * add backtrace to tException
          * add oop:is_a
          * on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
          * all throws/exits to tException:throw which does the wrapping described above

Reviewed By: eletuchy

Test Plan: been using this code on my live server ^_^

Revert: OK


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 02:10:20 +00:00
Mark Slee
09f69e0524 Add __autoload() support to Thrift-generated PHP code
Summary: Include thrift/autoload.php and use -phpa flag to generated code that works with autoload. Good for services with lots of methods that are typically not all invoked.

Reviewed By: dreiss

Test Plan: Falcon, baby, falcon.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665349 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:32:36 +00:00
Mark Slee
f5a6b0c109 Fix PHP TBufferedTransport readAll() to work with TSocket timeouts
Reviewed By: lucas

Test Plan: Invoke Buffered Transport wrapped around socket


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665348 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:27:17 +00:00
dweatherford
611434992a [thrift] Fix extension deserialization call with no classname
Summary: The extension expects a classname as a string and does not allow null;
  use the empty string instead of null in the absence of a classname to pass.

Reviewed By: mcslee
Test Plan: php -l
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665347 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 03:29:47 +00:00
Mark Slee
eab6ac8b18 Make sure to lazily initialize $TSPEC for structs even with no members
Reviewed By: dweatherford

Test Plan: Generate code with no E_ALL for method-less args


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665346 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 03:27:22 +00:00
Mark Slee
9e58f4330d Fix namespacing of included enum types in C++ generated code
Summary: If you reference enum types from an include you need to fully qualify their namespace in the generated C++ code.

Reviewed By: pfung

Test Plan: fbtypes code that pfung is using


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665345 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 02:48:52 +00:00