Commit Graph

1253 Commits

Author SHA1 Message Date
David Reiss
c465799c1b erlang: Refactor the write paths of the client and protocol
TODO: squash this

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990980 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:31 +00:00
David Reiss
3f660a4266 erlang: Client refactor, part 1
- Client is no longer a separate process.
- Simplified constructors moved into another module.
- All functions and exceptions return the new client,
  to allow for future statefulness in the client.

NOTE: With the new library and old gen-code, attempting to call a
nonexistent function will result in an exit.

TODO: fix docs and tests (tether test is not meaningful)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990979 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:29 +00:00
David Reiss
480d5ab62b erlang: Separate out thrift_protocol:read_specific
By giving a different name to the function that reads from the
protocol implementation, we can get a slightly more enforcible spec.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990977 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:26 +00:00
David Reiss
1cb979b3d0 erlang: Add a more detailed spec for thrift_protocol:read
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990976 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:25 +00:00
David Reiss
48b8124e32 erlang: Separate out thrift_binary_protocol:read_data
By giving a different name to the function that reads bytes from the
transport, we can get a slightly more detailed spec.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990975 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:23 +00:00
David Reiss
ee93398ccc erlang: Add some more detailed specs for protocol implementations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990974 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:22 +00:00
David Reiss
9b7fbe3743 erlang: Add some initial specs for thrift_transport and its implementations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990973 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:20 +00:00
David Reiss
5e6637b0ff erlang: Add some initial specs to thrift_client and thrift_protocol
Also add a special header for use in thrift_protocol implementations
that gives specs for the callbacks.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990972 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:18 +00:00
David Reiss
7772d931a1 erlang: Make framed_transport not write out its buffer when closed
This complicates the code, and users can be expected to call flush
when they want to write data to the underlying transport.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990969 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:15 +00:00
David Reiss
5db982cdf2 erlang: Make buffered_transport not write out its buffer when closed
This complicates the code, and users can be expected to call flush
when they want to write data to the underlying transport.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990968 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:13 +00:00
David Reiss
c0e4b5b246 erlang: Don't print a warning for application-defined exceptions
Application-defined exceptions are a normal occurrence as far as the
Thrift infrastructure is concerned, so we should not print a warning.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990967 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:12 +00:00
David Reiss
3e81fff832 erlang: Be a little more formal
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990966 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:11 +00:00
David Reiss
6d0be7235c erlang: Spell behaviour properly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990965 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:09 +00:00
David Reiss
d172a887ff erlang: Export cast/3 from thrift_client (dialyzer warning)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990964 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:08 +00:00
David Reiss
ba5a984271 erlang: Fix a dialyzer warning in thrift_disk_log_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990963 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:07 +00:00
David Reiss
14da1daf67 erlang: Fix a compiler warning in the disk_log transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990962 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:06 +00:00
David Reiss
58d312d516 erlang: Remove some unused modules
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990961 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:05 +00:00
David Reiss
fb2c1ae594 erlang: Enable compiler warnings for the library
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990959 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:02 +00:00
David Reiss
f32d0fb900 Rollback a few recent Erlang changes to fix blame data
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data.  I'll recommit r987018 as a sequence of patches and r988722
as its own rev.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:00 +00:00
David Reiss
73af3b7c4c THRIFT-869. python: Disguise ECONNRESET as EOF on BSD
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990955 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 21:57:07 +00:00
Bryan Duxbury
bcfb72a60b THRIFT-879. java: Remove @Override from TUnion.clear
Removes the unnecessary annotation.

Patch: Dave Engberg

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990931 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 20:27:32 +00:00
Todd Lipcon
90ec5bfcd0 THRIFT-873. java: Java tests fail due to Too many open files
- Drops TestTAsyncClientManager to use only 200 clients instead of 500
- Changes each unit test to run in its own JVM instead of sharing them.
- Allows the port used for binding the test servers to be configured from the command line


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990032 13f79535-47bb-0310-9956-ffa450edef68
2010-08-27 06:16:37 +00:00
Bryan Duxbury
89200e1c9d THRIFT-854. php: Provide configure option and make rules to build/install php extension
This patch adds a make target in lib/php that builds the php extension. By default configure will attempt to build this, but it can be disabled with --without-php_extension.

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@989226 13f79535-47bb-0310-9956-ffa450edef68
2010-08-25 17:09:02 +00:00
David Reiss
82c73194df THRIFT-866. erlang: Make specs compatible with Erlang R12
term() wasn't initially supported as an alias for any().

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@988722 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24 20:52:56 +00:00
Bryan Duxbury
66467a7779 THRIFT-693. java: Thrift compiler generated java code that throws compiler warnings about deprecated methods.
This patch removes the deprecated methods from TBase and makes some generator changes to accommodate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987805 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 17:48:18 +00:00
Bryan Duxbury
0d28efac2d THRIFT-855. py: Include optimized compiled python objects in install
This patch causes the .pyc files to be included in the install.

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987593 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 17:59:17 +00:00
Bryan Duxbury
3adf8aad36 THRIFT-845. java: async client does not respect timeout
This patch adds timeout handling to async method calls through TAsyncClientManager.

Patch: Ning Liang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987323 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 21:41:58 +00:00
Bryan Duxbury
d3879f80c6 THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients
The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.

Patch: David Reiss (assist to Anthony Molinaro)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 05:06:02 +00:00
Bryan Duxbury
184d26237a THRIFT-851. php: php extension fails to compile on centos 5.x
This patch introduces an approach that is compatbile with both centos and Mac.

Patch: Todd Lipcon

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@986410 13f79535-47bb-0310-9956-ffa450edef68
2010-08-17 17:43:58 +00:00
Bryan Duxbury
3ff373e26e THRIFT-846. js: JavaScript Test Framwork: extended Testcases
More testcases for the JavaScript library.

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985774 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 23:19:06 +00:00
David Reiss
cdde1854e7 THRIFT-247. Commit files missing from r985031
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985068 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 02:06:08 +00:00
Bryan Duxbury
7b1128c94f THRIFT-682. php: PHP extension doesn't compile on Mac OS X
This patch adds a bswap_64 implementation for OS X users.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 00:17:16 +00:00
Bryan Duxbury
0bb034008c THRIFT-831. java: FramedTransport implementation that reuses its buffers
This patch adds a TFastFramedTransport that is compatible with TFramedTransport, but makes use of a pair of internal, automatically-expanding buffers to avoid unnecessary reallocations. This makes interactions with the transport up to 2.5x faster.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985049 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 00:13:16 +00:00
Bryan Duxbury
f6b0e7cb38 THRIFT-842. java: Upgrade to current version of commons-lang (2.5 instead of 2.4) and/or change dependency in ivy.xml to not be exact
I switched us to using commons-lang 2.5.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985042 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:42:45 +00:00
David Reiss
cf8fc15fa0 THRIFT-837. php: Fix accelerator bug affecting writes > 8k
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985038 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:27:54 +00:00
David Reiss
112e30985b THRIFT-247. cpp: Basic THttpServer implementation for C++
This does not integrate with any existing HTTP server.  Rather, it is a
transport that parses HTTP requests to allow any of the blocking
socket-based servers to handle HTTP.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985031 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:03:29 +00:00
Bryan Duxbury
17115d7a52 THRIFT-778. php: PHP socket listening server
This patch which adds TServerTransport/TServerSocket, along with a generic TServer and TSimpleServer implementation.

Patch: Nick Jones

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984864 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 16:59:19 +00:00
Bryan Duxbury
7c74d9bfb1 THRIFT-780. php: Prevent aborts due to simultaneous exceptions
The bug was triggered when flush() threw an exception in the
PHPOutputTransport destructor.

The PHPOutputTransport in thrift_protocol_write_binary() wasn't
constructed inside of the try block, so exceptions thrown when it was
auto-flushing in the destructor were calling terminate().

Move the transport construction inside of the try block, and add an
explicit flush before the transport is destroyed (since throwing an
exception from a destructor is generally a bad thing).

Patch: David Reiss

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984815 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 15:00:41 +00:00
Bryan Duxbury
b149bc7050 THRIFT-718. php: Thrift PHP library includes closing tags and extraneous whitespace
This patch trims closing tags to avoid potential for whitespace.

Patch: Nicholas Telford

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984811 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 14:54:33 +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
7e9ac7bf59 rb: Make MemoryTransport's inspect_buffer method work in Ruby 1.9
Patch: Rajesh Malepati

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@983680 13f79535-47bb-0310-9956-ffa450edef68
2010-08-09 15:25:34 +00:00
Bryan Duxbury
ea67a78377 THRIFT-834. csharp: THttpClient resends contents of message after transport errors
This patch causes the send buffer to be refreshed even in the case of errors.

Patch: Anatoly Fayngelerin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@983067 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 17:50:51 +00:00
T Jake Luciani
b22b51eea2 THRIFT-815: fix for broken list testcase
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982853 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 02:37:45 +00:00
Bryan Duxbury
f5abd26858 THRIFT-830. java: Switch binary field implementation from byte[] to ByteBuffer
This patch switches the implementation of binary fields to ByteBuffer in the Java generated code, yielding up to 2.5x speed boost.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982839 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 00:18:25 +00:00
Bryan Duxbury
5a9fc65f55 oops, needed to add an ivy dependency on the servlet api jar
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982823 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:22:02 +00:00
Bryan Duxbury
ad776c1425 THRIFT-811. rb: http_client_transport.rb: allow custom http headers
Allows setting of custom http headers in http_client_transport.rb 

Patch: Tony Kamenick

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982804 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 22:12:01 +00:00
Bryan Duxbury
d74ca156b3 THRIFT-814. java: Include a TServlet in the standard Thrift distribution
This patch adds a TServlet implementation of the HttpServlet interface to be used with various containers. 

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982802 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 22:05:35 +00:00
Bryan Duxbury
067a7beb73 THRIFT-836. java: Race condition causes CancelledKeyException in TAsyncClientManager
This patch removes an erroneous key cancellation and adds exception handling for a bunch of different exceptions.
Patch: Ning Liang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982789 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 21:13:06 +00:00
Bryan Duxbury
5226eeaaaa THRIFT-751. java: Add clear() method to TBase
This patch adds a clear() method to the TBase interface and causes the compiler to generate implementations.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982774 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 20:44:53 +00:00
Bryan Duxbury
d8c7757b9d THRIFT-833. java: build.xml in lib/java is missing a classpathref attribute for the javadoc task
Turns out there was a missing classpathref that was causing lots of spurious warnings to be printed. This patch fixes that.

Patch: Nate McCall

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980548 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 19:30:47 +00:00