common/thrift.git
17 years agoRemove some trailing whitespace.
David Reiss [Fri, 7 Mar 2008 20:12:28 +0000 (20:12 +0000)] 
Remove some trailing whitespace.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665564 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd .gitignore file.
David Reiss [Fri, 7 Mar 2008 20:12:25 +0000 (20:12 +0000)] 
Add .gitignore file.

Ignore all generated files.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665563 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd Java JSON protocol implementation.
David Reiss [Fri, 7 Mar 2008 20:12:20 +0000 (20:12 +0000)] 
Add Java JSON protocol implementation.

Implement full-featured JSON protocol, low-level base-64 encode/decode
methods, and related tests.

Conflicts (resolved by dreiss):

test/java/build.xml

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665562 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd Java memory buffer transport implementation.
David Reiss [Fri, 7 Mar 2008 20:12:17 +0000 (20:12 +0000)] 
Add Java memory buffer transport implementation.

Wraps a TByteArrayOutputStream.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665561 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd NOT_IMPLEMENTED exception code.
David Reiss [Fri, 7 Mar 2008 20:12:13 +0000 (20:12 +0000)] 
Add NOT_IMPLEMENTED exception code.

Preparation for Java JSON protocol implementation.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665560 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd more complete base64 testing for C++ JSON protocol.
David Reiss [Fri, 7 Mar 2008 20:12:07 +0000 (20:12 +0000)] 
Add more complete base64 testing for C++ JSON protocol.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665559 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] ZTS fixes for thift_protocol extension
dweatherford [Thu, 6 Mar 2008 03:11:08 +0000 (03:11 +0000)] 
[thrift] ZTS fixes for thift_protocol extension

Summary: Now the threadsafe build compiles!
Reviewed by: mcslee
Test Plan: compiles, ship it
Revert: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665558 13f79535-47bb-0310-9956-ffa450edef68

17 years agorestore tags/1.0.0, we need these at least until fb9 is rolled everywhere
lucas [Wed, 5 Mar 2008 22:04:13 +0000 (22:04 +0000)] 
restore tags/1.0.0, we need these at least until fb9 is rolled everywhere

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665557 13f79535-47bb-0310-9956-ffa450edef68

17 years agoTNonblockingServer: Fix wrong exception names
David Reiss [Wed, 5 Mar 2008 07:51:47 +0000 (07:51 +0000)] 
TNonblockingServer: Fix wrong exception names

Reviewed By: dreiss

Test Plan: trivial :)

Revert: OK

DiffCamp Revision: 8789

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665556 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add writePtr(), wroteBytes() to TMemoryBuffer
David Reiss [Wed, 5 Mar 2008 07:51:44 +0000 (07:51 +0000)] 
Thrift: Add writePtr(), wroteBytes() to TMemoryBuffer

Summary: This adds the discussed interface to TMemoryBuffer, as follows:

         - writePtr(size) returns a ptr you can write (size) bytes to
         - wroteBytes() lets it know you wrote that many bytes

         To do this, I refactored an:
         - ensureCanWrite(size) private func

Reviewed By: dreiss

Test Plan: works in my test environment

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 8739

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665555 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: concurrency/Util.h: Add converters for 'struct timeval', cleanup
David Reiss [Wed, 5 Mar 2008 07:51:40 +0000 (07:51 +0000)] 
Thrift: concurrency/Util.h: Add converters for 'struct timeval', cleanup

Summary: - Added 'struct timeval' toMilliseconds and toTimeval converters modeled on the timespec ones
         - Added constants for microsecs, and got rid of the 500000 and 500 magic #'s :)

Reviewed By: dreiss

Test Plan: works in my test env

Revert: OK

DiffCamp Revision: 8742

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665554 13f79535-47bb-0310-9956-ffa450edef68

17 years agoChange the Java help to be a little more consistent.
David Reiss [Tue, 4 Mar 2008 21:10:41 +0000 (21:10 +0000)] 
Change the Java help to be a little more consistent.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665553 13f79535-47bb-0310-9956-ffa450edef68

17 years agoDon't declare getStaticLimitedReflection if gen_reflection_limited_ is off.
David Reiss [Tue, 4 Mar 2008 21:10:38 +0000 (21:10 +0000)] 
Don't declare getStaticLimitedReflection if gen_reflection_limited_ is off.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665552 13f79535-47bb-0310-9956-ffa450edef68

17 years agoChanged an awkward if/else if/else to be slightly less awkward.
David Reiss [Tue, 4 Mar 2008 21:10:34 +0000 (21:10 +0000)] 
Changed an awkward if/else if/else to be slightly less awkward.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665551 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo in configure.ac.
David Reiss [Tue, 4 Mar 2008 21:10:29 +0000 (21:10 +0000)] 
Fix a typo in configure.ac.

Used "==" instead of "=" in a test.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665550 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] Erlang build tweaks
Christopher Piro [Tue, 4 Mar 2008 07:09:12 +0000 (07:09 +0000)] 
[thrift] Erlang build tweaks

Summary: fix the Makefile to use BSD-friendly find(1) and enable conditional building of the Erlang binding.  Contributed by Dan Sully (daniel@electricrain.com).

Reviewed By: eletuchy

Test Plan: builds

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665549 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] PHP thrift_protocol extension, revision 2.0
dweatherford [Tue, 4 Mar 2008 01:08:23 +0000 (01:08 +0000)] 
[thrift] PHP thrift_protocol extension, revision 2.0

Summary:
  All PHP serialization and deserialization can now happen in extension-land,
  which should be much faster. This includes reading message headers and all
  complex types (structs, exceptions, whatever).

  The compiler has been updated to always emit the $_TSPEC static array for
  generated PHP code, since the new extension depends on it.

  As before, the PHP code gates enabling the accelerated serialization on
  the protocol being an instance of TBinaryProtocolAcclerated and the function
  for the [de]serialization operation existing.

  The function names have changed since the last version of the extension,
  so old and new generated code can coexist, and new generated code can run on
  a server with the old extension (but it will not use accelerated serialization).

Reviewed by: hzhao
Test Plan: Generated a couple of endpoints and called their services through the
  new extension. Both use a variety of nested complex types. Built and ran the
  extension in php-5.2.3 in debug mode, killed the reported memory leaks.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665548 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo in a warning message in thrifty.yy.
David Reiss [Sun, 2 Mar 2008 21:59:48 +0000 (21:59 +0000)] 
Fix a typo in a warning message in thrifty.yy.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665547 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAllow the C# library to be excluded from the build.
David Reiss [Sun, 2 Mar 2008 07:00:26 +0000 (07:00 +0000)] 
Allow the C# library to be excluded from the build.

Use AX_THRIFT_LIB to make configure support --without-csharp.
Don't bother testing for the C# requirements if this is set.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665546 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAllow the Java library to be excluded from the build.
David Reiss [Sun, 2 Mar 2008 07:00:22 +0000 (07:00 +0000)] 
Allow the Java library to be excluded from the build.

Use AX_THRIFT_LIB to make configure support --without-java.
Don't bother testing for the Java requirements if this is set.

This is necessary because the autoconf macros we are using for Java
cause configure to quit with an error if Java is not found.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665545 13f79535-47bb-0310-9956-ffa450edef68

17 years agoInfrastructure for excluding language libraries from the build.
David Reiss [Sun, 2 Mar 2008 07:00:19 +0000 (07:00 +0000)] 
Infrastructure for excluding language libraries from the build.

Add a new autoconf macro (a thin wrapper around AC_ARG_WITH) that
makes it pretty easy to include or exclude specific language libraries.

This will be tested along with future changes that use it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665544 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake the configure help more consistent.
David Reiss [Sun, 2 Mar 2008 07:00:15 +0000 (07:00 +0000)] 
Make the configure help more consistent.

Make the help strings generated by AX_THRIFT_GEN look more like
the ones from built-in autoconf macros.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665543 13f79535-47bb-0310-9956-ffa450edef68

17 years agoGenerate quality overrides of hashCode for Thrift structs (in Java).
David Reiss [Sun, 2 Mar 2008 06:29:23 +0000 (06:29 +0000)] 
Generate quality overrides of hashCode for Thrift structs (in Java).

This feature is turned off by default because it adds a new dependency:
Apache Commons Lang.  This package seems enough like Boost that
I would be open to turning this feature on by default.

Also updated test/java/build.xml to use this new option.
ant test still passes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665542 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd support for .equals() to Java structs.
David Reiss [Sun, 2 Mar 2008 06:29:19 +0000 (06:29 +0000)] 
Add support for .equals() to Java structs.

- Add a new method to t_java_generator that generates a .equals() method.
- Add a correct but useless implementation of hashCode for structs.
  (This is required by conventino when overriding .equals().)
- Add java_package to DebugProtoTest and OptionalRequiredTest.
- Add a new structure to OptionalRequiredTest to assist testing the behavior
  of .equals() with respect to null and unset fields.
- Clean up test/java/build.xml a bit.  (It still has a ways to go.)
- Add EqualityTest.java to test .equals().
- Add IdentityTest.java to test that writing and reading a structure
  preserves equality.

Tested by runnint atn test.
I also looked at the generated code for OptionalRequiredTest.thrift.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665541 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd a TDeserializer for Java.
David Reiss [Sun, 2 Mar 2008 06:29:16 +0000 (06:29 +0000)] 
Add a TDeserializer for Java.

The class is the reverse of TSerializer.
It allows you to deserialize a Thrift struct from a byte array (or String).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665540 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a comment in the Java TSerializer.
David Reiss [Sun, 2 Mar 2008 06:29:12 +0000 (06:29 +0000)] 
Fix a comment in the Java TSerializer.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665539 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd Stop methods for C# servers.
David Reiss [Sun, 2 Mar 2008 00:58:04 +0000 (00:58 +0000)] 
Add Stop methods for C# servers.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665538 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdding a few integration points to the C++ TSocketPool.
David Reiss [Sun, 2 Mar 2008 00:25:58 +0000 (00:25 +0000)] 
Adding a few integration points to the C++ TSocketPool.

- Adding ability to use a vector of TSocketPoolServers to construct a TSocketPool
- Ability to get back the list of TSocketPoolServers

This is especially useful in multithreaded client code that
will just keep around the list of servers, and create the pool
on every request. Since TSocketPool updates the failure stuff,
we need a way to get back the updated TSocketPoolServers

Reviewed By: aditya

Test Plan: just compiling the code

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665537 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix potential out of bounds read issue with getTypeIDForTypeName().
David Reiss [Sun, 2 Mar 2008 00:20:47 +0000 (00:20 +0000)] 
Fix potential out of bounds read issue with getTypeIDForTypeName().

Make sure type name is at least 2 characters long.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665536 13f79535-47bb-0310-9956-ffa450edef68

17 years agoBug fix for C++ TSocketPool
David Reiss [Fri, 29 Feb 2008 07:33:47 +0000 (07:33 +0000)] 
Bug fix for C++ TSocketPool

Wasn't setting the host or port for each server in the pool on open.

Reviewed By: dbraginsky

Test Plan: Just compiled.  Will test with dbraginsky's server.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665535 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFail and retry logic for TSocketPool
David Reiss [Thu, 28 Feb 2008 21:20:12 +0000 (21:20 +0000)] 
Fail and retry logic for TSocketPool

Summary: Replicating php logic: If opening fails enough times, mark server as down for some amount of time

Reviewed By: aditya

Test Plan: compiling thrift - any good test ideas?

Revert: OK

DiffCamp Revision: 8381

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665534 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix for JSON Protocol string-reading methods.
David Reiss [Thu, 28 Feb 2008 21:11:39 +0000 (21:11 +0000)] 
Fix for JSON Protocol string-reading methods.

Clear return-by-reference strings before appending to them
in the JSON Protocol reading methods.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665533 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix for Base64 decoding.
David Reiss [Thu, 28 Feb 2008 21:11:34 +0000 (21:11 +0000)] 
Fix for Base64 decoding.

Previously, the Base64 decoding table only covered ASCII characters,
but the decoding function looked up any character in the table.
This change extends the table.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665532 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] erlang: fixing error logger for devious "not-quite-right" lists
eletuchy [Wed, 27 Feb 2008 23:50:21 +0000 (23:50 +0000)] 
[thrift] erlang: fixing error logger for devious "not-quite-right" lists

Summary: ... a la dictionary

Reviewed By: cpiro

Test Plan: bin_trim of a dict with a stored integer value

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665531 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a subtle bug in cpp_use_include_path.
David Reiss [Wed, 27 Feb 2008 22:28:12 +0000 (22:28 +0000)] 
Fix a subtle bug in cpp_use_include_path.

Summary:
I thought I had eliminated all the places where work was only done
if cpp_use_include_path was set.  I guess I missed one.

Reviewed By: mcslee, mrabkin, kholst

Test Plan:
Built BigGrep and looked at the generated code.

Revert Plan: ok

DiffCamp Revision: 8375

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665530 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] erlang: dialyzer bug: binary protocol double type ...
eletuchy [Wed, 27 Feb 2008 19:56:52 +0000 (19:56 +0000)] 
[thrift] erlang: dialyzer bug: binary protocol double type ...

Summary: ... needs to be specified as a float to work, since
         erlang's binary syntax default is "integer"

Reviewed By: cpiro

Test Plan: make dialyzer -j

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665529 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] erlang: dialyzer bug: bad usage of ++ operator on a non-list
eletuchy [Wed, 27 Feb 2008 19:55:15 +0000 (19:55 +0000)] 
[thrift] erlang: dialyzer bug: bad usage of ++ operator on a non-list

Reviewed By: cpiro

Test Plan: make dialyzer -j

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665528 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd an operator< for Thrift structs (in C++).
David Reiss [Wed, 27 Feb 2008 19:38:51 +0000 (19:38 +0000)] 
Add an operator< for Thrift structs (in C++).

Some people want to use sets of Thrift structs.  This has interesting
implications, but it is a reasonable request.  However, in C++,
this requires structures to have a less-than operator.
It seems a little dangerous to auto-generate an arbitrary comparator,
but allowing users to define their own operator< implementations
seems fine.  This change makes that a lot easier.

The one downside of this change is that developers who try to compare
structures with operator< (including trying to make sets of them)
will now get a linker error instead of a compiler error.
However, the old compiler error was so scary that
I'm not sure this is any worse.

Reviewed By: kholst, mcslee

Test Plan: make check

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665527 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] erlang: dialyzer bug: tSocket reading of send_timeout preference
eletuchy [Wed, 27 Feb 2008 19:27:41 +0000 (19:27 +0000)] 
[thrift] erlang: dialyzer bug: tSocket reading of send_timeout preference

Reviewed By: cpiro

Test Plan: make dialyzer

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665526 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] erlang dialyzer error
eletuchy [Wed, 27 Feb 2008 18:38:42 +0000 (18:38 +0000)] 
[thrift] erlang dialyzer error

Summary: impossible pattern matches are never good

Reviewed By: cpiro

Test Plan: make dialyzer

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665525 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] make erlang error logger more efficient
eletuchy [Wed, 27 Feb 2008 17:43:40 +0000 (17:43 +0000)] 
[thrift] make erlang error logger more efficient

Summary: when omit_fmt is included

Reviewed By: cpiro

Test Plan: sanity checked a service to make sure it ran

Revert Plan: sure

Other Notes: TODO - make reconfiguration work with this

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665524 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] adding dialyzer to erlang library Makefile
eletuchy [Wed, 27 Feb 2008 17:41:05 +0000 (17:41 +0000)] 
[thrift] adding dialyzer to erlang library Makefile

Summary: ... because static analysis can find bugs

Reviewed By: cpiro

Test Plan: cd src ; make dialyzer -j
     gape in awe at errors

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665523 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] making erlang thrift error logger slightly nicer for printing binaries
eletuchy [Wed, 27 Feb 2008 16:31:01 +0000 (16:31 +0000)] 
[thrift] making erlang thrift error logger slightly nicer for printing binaries

Reviewed By: cpiro

Test Plan: ran some services ... verified that they worked

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665522 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a warning message.
David Reiss [Wed, 27 Feb 2008 07:45:10 +0000 (07:45 +0000)] 
Fix a warning message.

Forgot to update this when copy-pasting.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665521 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake limited reflection optional (off by default).
David Reiss [Wed, 27 Feb 2008 07:45:05 +0000 (07:45 +0000)] 
Make limited reflection optional (off by default).

Limited reflection is deprecated, and it is slowing down compilation.
This change will disable generation of static reflection by default,
but it adds a command line argument to re-enable it.

Tested by running make check and building the C++ test client and server.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665520 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUpdate test/Makefile.am to use the new compiler command-line format.
David Reiss [Wed, 27 Feb 2008 07:45:00 +0000 (07:45 +0000)] 
Update test/Makefile.am to use the new compiler command-line format.

Tested by running make check.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665519 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake compiler work on cpp_includes with < in them
Mark Slee [Wed, 27 Feb 2008 04:29:34 +0000 (04:29 +0000)] 
Make compiler work on cpp_includes with < in them

Reviewed By: spiantino

Test Plan: build multifeed aggregator

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665518 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAllow the Thrift compiler to be built without the Java generator.
David Reiss [Wed, 27 Feb 2008 02:39:25 +0000 (02:39 +0000)] 
Allow the Thrift compiler to be built without the Java generator.

- Use AX_THRIFT_GEN to make configure support --disable-gen-java
- Update the compiler Makefile.am to exclude the generator.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665517 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAllow the Thrift compiler to be built without the C++ generator.
David Reiss [Wed, 27 Feb 2008 01:55:33 +0000 (01:55 +0000)] 
Allow the Thrift compiler to be built without the C++ generator.

- Use AX_THRIFT_GEN to make configure support --disable-gen-cpp
- Update the compiler Makefile.am to exclude the generator.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665516 13f79535-47bb-0310-9956-ffa450edef68

17 years agoInfrastructure for excluding code generators from the Thrift compiler.
David Reiss [Wed, 27 Feb 2008 01:55:30 +0000 (01:55 +0000)] 
Infrastructure for excluding code generators from the Thrift compiler.

Add a new autoconf macro (a thin wrapper around AC_ARG_ENABLE) that
makes it pretty easy to include or exclude specific code genreators.

This will be tested along with future changes that use it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665515 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake the Java generator use non-hardcoded namespaces.
David Reiss [Wed, 27 Feb 2008 01:55:25 +0000 (01:55 +0000)] 
Make the Java generator use non-hardcoded namespaces.

- Make the Java generator use program->get_namespace("java")
  instead of program->get_java_namespace()
- Eliminate the explicit "java_namespace" in t_program.
- Deprecate the java_namespace token.
- Update example .thrift files and syntax files.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665514 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake the C++ generator use non-hardcoded namespaces.
David Reiss [Wed, 27 Feb 2008 01:55:17 +0000 (01:55 +0000)] 
Make the C++ generator use non-hardcoded namespaces.

- Make the C++ generator use program->get_namespace("cpp")
  instead of program->get_cpp_namespace()
- Eliminate the explicit "cpp_namespace" in t_program.
- Deprecate the cpp_namespace token.
- Update example .thrift files and syntax files.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665513 13f79535-47bb-0310-9956-ffa450edef68

17 years agoInfrastructure for a language-neutral namespace declaration.
David Reiss [Wed, 27 Feb 2008 01:55:13 +0000 (01:55 +0000)] 
Infrastructure for a language-neutral namespace declaration.

Altered the once-deprecated "namespace" directive in .thrift files
to take two identifiers: the language and the namespace.
They are stored in a map inside of the program object.
Future changes will convert specific generators to use this map
and deprecate the old language-specific tokens.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665512 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRemove t_java_generator.h.
David Reiss [Wed, 27 Feb 2008 01:55:09 +0000 (01:55 +0000)] 
Remove t_java_generator.h.

t_java_generator.h is no longer included anywhere, because
the Java generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665511 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake the Java generator dynamic.
David Reiss [Wed, 27 Feb 2008 01:55:05 +0000 (01:55 +0000)] 
Make the Java generator dynamic.

- Modify the Java generator constructor to fit the new generic interface.
- Register the Java genrator with the central registry.
- Deprecate the old way of invoking the Java generator.
- main.cc no longer includes t_java_generator.h.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665510 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRemove t_cpp_generator.h.
David Reiss [Wed, 27 Feb 2008 01:54:59 +0000 (01:54 +0000)] 
Remove t_cpp_generator.h.

t_cpp_generator.h is no longer included anywhere, because
the C++ generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665509 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake the C++ generator dynamic.
David Reiss [Wed, 27 Feb 2008 01:54:55 +0000 (01:54 +0000)] 
Make the C++ generator dynamic.

- Modify the C++ generator constructor to fit the new generic interface.
- Register the C++ genrator with the central registry.
- Deprecate the old way of invoking the C++ generator.
- main.cc no longer includes t_cpp_generator.h.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665508 13f79535-47bb-0310-9956-ffa450edef68

17 years agoInfrastructure for loading code generators a bit more dynamically.
David Reiss [Wed, 27 Feb 2008 01:54:51 +0000 (01:54 +0000)] 
Infrastructure for loading code generators a bit more dynamically.

Add a generic and easy-to-use mechanism for Thrift code generators to
register themselves centrally.  The central registry is used to
obtain documentation for the options accepted by individual generators
and get instances of individual generators.  It also does a little bit of
option parsing that will be useful for all generators.

Obviously, this change cannot be tested on its own.  I can only say
that Thrift still builds and runs correctly.  Subsequent changes
will apply this infrastructure to specific code generators.
Steve Grimm has assured me that this is standard Git practice.

In fact, I ran this test after converting the C++ and Java generators:

dreiss@dreiss-vmware:dynamic_generators:thrift/test$ mkdir old new
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ cd old
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ ../../compiler/cpp/thrift -cpp -dense -java -javabean ../DebugProtoTest.thrift
[WARNING::1] -cpp is deprecated.  Use --gen cpp
[WARNING::1] -java is deprecated.  Use --gen java
[WARNING::1] -javabean is deprecated.  Use --gen java:beans
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ cd ../new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ ../../compiler/cpp/thrift --gen cpp:dense --gen java --gen java:beans ../DebugProtoTest.thrift
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ cd ..
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ diff -ur old/ new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test$

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665507 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake warnings from the Thrift compiler a little clearer.
David Reiss [Wed, 27 Feb 2008 01:54:47 +0000 (01:54 +0000)] 
Make warnings from the Thrift compiler a little clearer.

Reviewed by: mcslee

Warning and error messages from the Thrift compiler include
the file currently being parsed and the line number.
This change sets those to dummy values for stages that
have nothing to do with parsing.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665506 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] don't do a reverse DNS lookup for every erlang thrift request
eletuchy [Tue, 26 Feb 2008 12:11:29 +0000 (12:11 +0000)] 
[thrift] don't do a reverse DNS lookup for every erlang thrift request

Reviewed By: cpiro

Test Plan: ran a server ... verified its debug messages no longer included
     hostnames

Notes: methinks this binding is not long for this world

Revert Plan: sure ... if you don't like your dns server

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665505 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] better error handling and timeouts in tSocket code
eletuchy [Tue, 26 Feb 2008 11:44:00 +0000 (11:44 +0000)] 
[thrift] better error handling and timeouts in tSocket code

Summary: default socket send timeout to 5seconds, not infinity.
         close the socket in case of an error.

Reviewed By: cpiro

Test Plan: ran a client for slow services
     and sanity checked other client code to make sure

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665504 13f79535-47bb-0310-9956-ffa450edef68

17 years agoTighten integration with Ruby exceptions by tying in Exception#message
David Reiss [Tue, 26 Feb 2008 06:40:25 +0000 (06:40 +0000)] 
Tighten integration with Ruby exceptions by tying in Exception#message

For Thrift exceptions that contain only a single string field, integrate
these even more tightly with Ruby exceptions by aliasing Ruby's
Exception#message field with the Thrift field.

Ruby exception objects created by Thrift will now display properly in
Ruby backtraces, etc. without any special handling by client code.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665503 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMove Ruby fielded object creation from generated constructor to ThriftStruct
David Reiss [Tue, 26 Feb 2008 06:40:22 +0000 (06:40 +0000)] 
Move Ruby fielded object creation from generated constructor to ThriftStruct

Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as

  o = ThriftObject.new :field1 => value1, :field2 => value2, ...

are supported as before, and the string form,

  o = ThriftObject.new "field1" => value1, "field2" => value2, ...

disabled by the previous patch now also works.

Placing this code in the module is also just a cleaner solution.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRuby exception constructor bugfix
David Reiss [Tue, 26 Feb 2008 06:40:16 +0000 (06:40 +0000)] 
Ruby exception constructor bugfix

The Ruby exception constructor is modified to accept 0 arguments, which is
how Thrift library code creates exception objects. Without this fix, Thrift
Ruby clients that receive exception objects crash.

The call to super (resolving to ThriftStruct#initialize) is retained, but
is called with the default value (an empty hash) instead of passing the
message along.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665501 13f79535-47bb-0310-9956-ffa450edef68

17 years agoadd increase_max_fds to the new TServer.cpp
veeve [Tue, 26 Feb 2008 05:12:08 +0000 (05:12 +0000)] 
add increase_max_fds to the new TServer.cpp

Summary: - added TServer.cpp
         - increase_max_fds() defaults to 2^24.

Reviewed By: dreiss

Test Plan: - Linked this code into chatloggerd and verified the return value.

Revert: OK

TracCamp Project: Chirp

DiffCamp Revision: 8275

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665500 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUse "all-local" instead of all in Makefile.am.
David Reiss [Sun, 24 Feb 2008 17:45:03 +0000 (17:45 +0000)] 
Use "all-local" instead of all in Makefile.am.

Summary:
Redefining an Automake rule totally blows away anything Automake puts in place.
By using all-local instead of all, we can just add to the generated rule.

Reviewed By: marc

Test Plan: make

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665499 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake "make clean" rules a bit more standard.
David Reiss [Sun, 24 Feb 2008 16:42:18 +0000 (16:42 +0000)] 
Make "make clean" rules a bit more standard.

Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".

Reviewed By: marc

Test Plan: make clean

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake "make check" work properly for Python and Java.
David Reiss [Sun, 24 Feb 2008 02:03:17 +0000 (02:03 +0000)] 
Make "make check" work properly for Python and Java.

Summary:
The Python and Java versions of "make check" only work if "make all" has
been run.  Our automake-fu isn't strong enough to make proper dependencies,
so this hack suggested by Nitay will force the libraries to be built
before make check is run.

Test Plan: make check

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665497 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd automake support for running the Java tests.
David Reiss [Sat, 23 Feb 2008 22:07:46 +0000 (22:07 +0000)] 
Add automake support for running the Java tests.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665496 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUpdate TJSONProtocol to TSimpleJSONProtocol
David Reiss [Sat, 23 Feb 2008 22:07:43 +0000 (22:07 +0000)] 
Update TJSONProtocol to TSimpleJSONProtocol

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665495 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd automake support for building the Java library.
David Reiss [Sat, 23 Feb 2008 22:07:39 +0000 (22:07 +0000)] 
Add automake support for building the Java library.

If java, javac, and ant are all available, the Java library will be built as part of the standard make target.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665494 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Clean up cleanup.sh and bootstrap.sh
David Reiss [Sat, 23 Feb 2008 21:56:16 +0000 (21:56 +0000)] 
Thrift: Clean up cleanup.sh and bootstrap.sh

Reviewed By: marc

Test Plan:
dreiss@dreiss-vmware:cleanup:thrift/if$ ../cleanup.sh
dreiss@dreiss-vmware:cleanup:thrift/if$ git clean -nxd
dreiss@dreiss-vmware:cleanup:thrift/if$

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665493 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRename TJSONProtocol.java -> TSimpleJSONProtocol.java
David Reiss [Thu, 21 Feb 2008 22:49:58 +0000 (22:49 +0000)] 
Rename TJSONProtocol.java -> TSimpleJSONProtocol.java

Summary:
Chad Walters is developing a full-featured JSON-based protocol for Java,
so we're renaming the existing protocol to something more descriptive.
I also edited the file to rename the class and add to the header comment.
I have no idea if Subversion does explicit rename tracking, or if
git svn is smart enough to mark renames as such, but I would predict
"yes" to both.  Let's find out.

Reviewed By: mcslee, jssarma

Test Plan: Ran "ant" in lib/java

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665492 13f79535-47bb-0310-9956-ffa450edef68

17 years agoTJSONProtocol no longer uses borrow, and miscellaneous fixes.
David Reiss [Thu, 21 Feb 2008 22:37:45 +0000 (22:37 +0000)] 
TJSONProtocol no longer uses borrow, and miscellaneous fixes.

Summary:
Added a LookaheadReader to the TJSONProtocol so it doesn't have to
rely on the transport to borrow.
Also added a check to a corner case and fixed up some comments and whitespace.

Reviewed By: mcslee

Test Plan: make check

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665491 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] Erlang thrift_sup will exit if it can't bind to the given address
Christopher Piro [Wed, 20 Feb 2008 08:19:38 +0000 (08:19 +0000)] 
[thrift] Erlang thrift_sup will exit if it can't bind to the given address

Summary: before it would complain and not exit.  that's not right.

Reviewed By: eletuchy

Test Plan: DEATH ENSUES

Revert Plan: sounds reasonable

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665490 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo in the C# generator.
David Reiss [Wed, 20 Feb 2008 05:30:55 +0000 (05:30 +0000)] 
Fix a typo in the C# generator.

Actually, it is not a typo.  The original authors didn't convert one call
to get_java_package to get_csharp_namespace.

Tested by building Thrift.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665489 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo
David Reiss [Wed, 20 Feb 2008 02:28:05 +0000 (02:28 +0000)] 
Fix a typo

Reviewed By: mcslee

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665488 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add "#include <cstdlib>" in a few places and s/malloc/std::malloc/
David Reiss [Tue, 19 Feb 2008 22:47:29 +0000 (22:47 +0000)] 
Thrift: Add "#include <cstdlib>" in a few places and s/malloc/std::malloc/

Summary:
There were a few places where we were calling malloc/reallaoc/free without
including cstdlib (or stdlib.h).  This is broken, but it worked because
other headers that we were including included stdlib.h.  However, on a
platform where this wasn't true, it broke the Thrift build.  This change
adds the proper includes.  It also changes malloc to std::malloc (same
with realloc and free) in a few places, because that is the correct way
of doing it when you include cstdlib.

Reviewed By: mcslee

Test Plan: Compiled Thrift.

Revert Plan: ok

Other Notes:
This bug was noticed by a Thrudb user, and the patch was sent in by
Ross McFarland.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665487 13f79535-47bb-0310-9956-ffa450edef68

17 years agoEnhance C++ test client to make sure that async void is implemented properly
David Reiss [Mon, 18 Feb 2008 02:11:52 +0000 (02:11 +0000)] 
Enhance C++ test client to make sure that async void is implemented properly

Summary:
Added another i32 test after the async test. If testAsync improperly
sends a response, then the i32 test will fail because the function
name won't match up, since it will be "off by one".

Test plan:
Tested cpp server and it works. Tested alterl server which
doesn't yet implement async void properly and verified failure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665486 13f79535-47bb-0310-9956-ffa450edef68

17 years agoImplement testAsync for python tests
David Reiss [Mon, 18 Feb 2008 02:11:48 +0000 (02:11 +0000)] 
Implement testAsync for python tests

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665485 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd testAsync to ThriftTest.thrift which verifies async void works properly.
David Reiss [Mon, 18 Feb 2008 02:11:44 +0000 (02:11 +0000)] 
Add testAsync to ThriftTest.thrift which verifies async void works properly.

Summary:
  - testAsync takes a number of seconds to sleep. The test client makes sure
    that the RPC returns in less than 0.2 seconds even though it asks the server
    to sleep for 3 seconds.
  - Implemented this test for C++ and Java.

Test Plan:
  - ran cpp TestServer and TestClient and verified functionality
  - tested cpp and java test server/client against each other - tests passed

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665484 13f79535-47bb-0310-9956-ffa450edef68

17 years agoChange test scripts for Java to point to libthrift.jar in source tree.
David Reiss [Mon, 18 Feb 2008 02:11:39 +0000 (02:11 +0000)] 
Change test scripts for Java to point to libthrift.jar in source tree.

Summary:
  - They used to point at /usr/local/lib/libthrift.jar even though the build.xml pointed
    at a relative path in the source tree

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665483 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add a full-featured JSON protocol for C++.
David Reiss [Mon, 18 Feb 2008 01:49:37 +0000 (01:49 +0000)] 
Thrift: Add a full-featured JSON protocol for C++.

Summary:
This change adds a new and exciting protocol to Thrift.  It uses
RFC-compliant JSON as the wire protocol and is fully human readable.
(once a little whitespace has been inserted.)  Unlike the existing
JSON protocol for Java, which is intended to allow Thrift data to be
transferred to scripting languages, this protocol is lossless and fully
read-write.  It was written by Chad Walters of Powerset and reviewed
by David Reiss.

Tested by running make check.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665482 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Distinguish between string and binary types in C++ and Java.
David Reiss [Fri, 15 Feb 2008 01:38:18 +0000 (01:38 +0000)] 
Thrift: Distinguish between string and binary types in C++ and Java.

Summary:
The upcoming TJSONProtocol handles string and binary types quite differently.
This change makes that distinction in all parts of the C++ binding.

Java already distinguished between string and binary, but this change
also updates the Java skip method to skip over strings as binary
so we don't get encoding errors when skipping binary data.

Reviewed By: mcslee

Test Plan: make check

Revert Plan: ok

Other Notes:
I just pulled this out of Chad Walters' JSON patch.
The only other change was adding readBinary (or was it writeBinary)
to TDenseProtocol.  Maybe inheriting from TBinaryProtocol wasn't a good idea.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665481 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Python test improvements.
David Reiss [Fri, 15 Feb 2008 01:10:23 +0000 (01:10 +0000)] 
Thrift: Python test improvements.

Summary:
- Add a serialization test for forwards/backwards compatibility.
- Hook the Python tests up to "make check".
- Miscellaneous changes to the Python tests.

Reviewed By: mcslee

Test Plan: Ran the test.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665480 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug in the skip function in Python's fastbinary.c
David Reiss [Thu, 14 Feb 2008 20:20:08 +0000 (20:20 +0000)] 
Thrift: Fix a bug in the skip function in Python's fastbinary.c

Reviewed By: mcslee

Other Notes:
Submitted by Ben Maurer (the original author).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665479 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] making generated php struct readers more compact
eletuchy [Wed, 13 Feb 2008 22:44:24 +0000 (22:44 +0000)] 
[thrift] making generated php struct readers more compact

Summary: introducing a $bin_accel variable in struct reader scope that
         can be reference by the deserializers of each field

Reviewed By: dreiss, mcslee

Test Plan: regenerated a thrift service, compared before and after calls

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665478 13f79535-47bb-0310-9956-ffa450edef68

17 years ago [thrift] grrrr ... TPhpStream can read the string '0'
eletuchy [Wed, 13 Feb 2008 22:41:03 +0000 (22:41 +0000)] 
[thrift] grrrr ... TPhpStream can read the string '0'

    Summary: php sucks

    Reviewed By: mcslee

    Test Plan: thrift call with string '0' has same behavior as string '1'

    Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665477 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix Java generator for javabean target to construct maps and lists properly
Mark Slee [Wed, 13 Feb 2008 22:03:15 +0000 (22:03 +0000)] 
Fix Java generator for javabean target to construct maps and lists properly

Summary: From Johann Oskarsson

Reviewed By: dreiss

Test Plan: Generate javabean code

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665476 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[erl-thrift] tiny change to exception message for tSocket:connect
eletuchy [Wed, 13 Feb 2008 00:48:15 +0000 (00:48 +0000)] 
[erl-thrift] tiny change to exception message for tSocket:connect

Summary: calls integer_to_list on the port

Reviewed By: dreiss

Test Plan: connected a client to non-running server. oh noes, exception.

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665475 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add some macros to configure.ac.
David Reiss [Mon, 11 Feb 2008 23:24:47 +0000 (23:24 +0000)] 
Thrift: Add some macros to configure.ac.

Summary:
./bootstrap.sh has been throwing warnings because we haven't kept
configure.ac up to date.  This fixes that.

Reviewed By: mcslee

Test Plan: ./boostrap.sh

Revert Plan: ok

Other Notes:
Contributed by Dan Sully.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665474 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift haskell getTransport working
iproctor [Mon, 11 Feb 2008 22:59:01 +0000 (22:59 +0000)] 
Thrift haskell getTransport working

Summary: getTransport is now a method of Protocol. To flush the transport one does tflush (getTransport p) instead of pflush p. This is more like how it is done with other languages.

Reviewed By: dcorson

Test Plan: Ran thrifttest for haskell.

Revert: OK

DiffCamp Revision: 7515

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665473 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug with local reflection and namespaces.
David Reiss [Sat, 9 Feb 2008 02:51:43 +0000 (02:51 +0000)] 
Thrift: Fix a bug with local reflection and namespaces.

Summary:
References to "local reflections" in other thrift files were not given
namespace prefixes, give undefined symbol errors.  This change
distinguishes between relfection names being generated for declarations
(not namespaced) and those that could be external references (namespaced).

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

==> test1.thrift <==
cpp_namespace ns
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
enum dummy_enum_workaround { I_AM_A_WORKAROUND }
struct baz {
  1: test1.foo qux
}

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665472 13f79535-47bb-0310-9956-ffa450edef68

17 years agoGetters for input/output protocol in client lib
Mark Slee [Sat, 9 Feb 2008 00:26:29 +0000 (00:26 +0000)] 
Getters for input/output protocol in client lib

Summary: Why not, nice to have. From Ted Dziuba.

Reviewed By: dreiss

Test Plan: Build Java compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665471 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUse interfaces, not classes for Java gen
Mark Slee [Sat, 9 Feb 2008 00:18:32 +0000 (00:18 +0000)] 
Use interfaces, not classes for Java gen

Summary: Not AbstractMap or HashSet, etc. use Map, List, Set

Reviewed By: dreiss

Test Plan: Generate Java code and build java tests

Other Notes: Submitted by Seth Falcon

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665470 13f79535-47bb-0310-9956-ffa450edef68

17 years agoPatch from Ross McFarland to compile with strict warnings
Mark Slee [Sat, 9 Feb 2008 00:02:26 +0000 (00:02 +0000)] 
Patch from Ross McFarland to compile with strict warnings

Summary: Use comment trick in params that are unused to prevent warnings

Reviewed By: dreiss

Test Plan: Generate C++ code and compile -W -Wall

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665469 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug in local reflection generation.
David Reiss [Fri, 8 Feb 2008 21:58:06 +0000 (21:58 +0000)] 
Thrift: Fix a bug in local reflection generation.

Summary:
The problem was that in generate_local_reflection, we refused to
generate reflections for types defined in another program, including enums.
But in local_reflection_name, we treated enums like base types,
assuming that their reflections were always defined in this program.
One solution would be to treat enums like base types everywhere, and always
generate their reflections in the program where they were being used.
But this change takes the opposite approach.  We now always
generate fingerprints for enums in the program in which they are defined,
even if they are not used there.

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

dreiss@dreiss-vmware:reflection:thrift/test$ tail test[12].thrift
==> test1.thrift <==
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
struct baz {
  1: test1.foo qux
}

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665468 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Whitespace cleanup.
David Reiss [Wed, 6 Feb 2008 22:18:40 +0000 (22:18 +0000)] 
Thrift: Whitespace cleanup.

Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Update some makefiles to make "make dist" work.
David Reiss [Wed, 6 Feb 2008 22:10:26 +0000 (22:10 +0000)] 
Thrift: Update some makefiles to make "make dist" work.

Reviewed By: mcslee

Test Plan: Ran "make dist" and did a diff.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665466 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add a Makefile to build the C# library with Mono.
David Reiss [Wed, 6 Feb 2008 22:10:12 +0000 (22:10 +0000)] 
Thrift: Add a Makefile to build the C# library with Mono.

Reviewed By: mcslee

Test Plan: Installed Mono and built it.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665465 13f79535-47bb-0310-9956-ffa450edef68