Commit Graph

115 Commits

Author SHA1 Message Date
David Reiss
38104c8234 THRIFT-886. erlang: Fix dialyzer warning in thrift_http_transport
This spec should have been updated in r990996

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991603 13f79535-47bb-0310-9956-ffa450edef68
2010-09-01 16:54:05 +00:00
David Reiss
5f11084c06 THRIFT-785. erlang: Eliminate log spew with framed transport
If we get an error when reading from the underlying transport, propagate
it out instead of dying and generating error logs.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991005 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:11:58 +00:00
David Reiss
f4494ee3a9 erlang: Un-revert r988722
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991003 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:06:03 +00:00
David Reiss
c549f7b086 erlang: Eliminate "behaviour undefined" warnings
Build behaviour modules first and include the ebin directory in
the Erlang code path during the rest of the build.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991002 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:06:01 +00:00
David Reiss
df2047e4b1 erlang: Parse multiple options properly in disk_log_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991001 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:06:00 +00:00
David Reiss
b4ab008476 erlang: Verify elt/key/val when reading list/set/map
For now, exit on a badmatch if one is wrong.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991000 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:58 +00:00
David Reiss
5ed313d998 erlang: Fix several compilation warnings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990999 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:57 +00:00
David Reiss
cf7f3973bb erlang: Rename _impl headers to _behaviour
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990998 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:55 +00:00
David Reiss
a9c5283329 erlang: Fix a few spelling errors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990997 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:53 +00:00
David Reiss
3a292b4441 erlang: Don't use a separate process for http_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990996 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:51 +00:00
David Reiss
48539bc960 erlang: Don't use a separate process memory_buffer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990995 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:50 +00:00
David Reiss
bc1b3fdb77 erlang: Don't use a separate process for framed_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990992 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:47 +00:00
David Reiss
0127af242f erlang: Don't use a separate process for buffered_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990991 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:46 +00:00
David Reiss
9b170ebf10 erlang: Add a state-propagation-testing transport
Add a transport implementation that forwards all read and write (and
flush and close) requests directly to a wrapped transport.  In addition,
it keeps a small amount of state: a version number that is incremented
on each operation and the PID of a process that stores another copy of
the version number.  Every operation compares the version numbers and
increments both.  If some part of the Thrift stack doesn't propagate
state updates properly, the two versions will not match.

Also add some (compiled-off by default) code to thrift_transport to
auto-wrap every transport in a state checker.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990990 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:44 +00:00
David Reiss
639e1cfe2b erlang: Refactor thrift_transport and all transport implementations
Note that the buffering transports still use a separate process to
maintain their state.  This change just changes them to use a
"return-the-new-version"-style API.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990989 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:43 +00:00
David Reiss
035979ff80 erlang: Refactor the processor
Now the server works.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990986 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:38 +00:00
David Reiss
4b0534a662 erlang: Get rid of after_reply from thrift_processor
We are always flushing the response after we write it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990985 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:37 +00:00
David Reiss
b9561c83f5 erlang: Don't catch exits in thrift_processor
They are not handled properly, so the exit backtrace gets lost.
Just ignore them and let them kill the process naturally.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990984 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:36 +00:00
David Reiss
63f6126e97 erlang: Refactor the binary protocol
At this point, everything passes dialyzer except for the processor,
and the client works.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990983 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:34 +00:00
David Reiss
6c1875340a erlang: Refactor the read path of the protocol
TODO: squash this

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990982 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:33 +00:00
David Reiss
82862950f6 erlang: Refactor the read path of the client
TODO: squash this

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990981 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:32 +00:00
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
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
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
David Reiss
d09f09c89d THRIFT-784. erl: Fix two problems with "make install"
- Support DESTDIR.
- Pass proper arguments to install.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@945898 13f79535-47bb-0310-9956-ffa450edef68
2010-05-18 21:32:16 +00:00
David Reiss
9e2fd7987d THRIFT-646. erlang: Misc build cleanups
- Use AC_ERLANG_PATH_ERLC to find erlc, instead of the generic
  AC_PATH_PROG.
- Also check for erl, just in case it is used internally by checks.
- Use AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR instead of manual hackery to
  find the location where Erlang libraries should be installed.  (This
  doesn't use the discovered version of Erlang, though.  See
  http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00003.html .)
- Minor style changes in Makefile.am
- Remove some hacks we were using in the old makefile that were
  necessary because we were not using automake.
- Remove ebin in a "maintainer-clean-local" rule to avoid shadowing the
  default "maintainer-clean" rule which handles MAINTAINERCLEANFILES.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@945744 13f79535-47bb-0310-9956-ffa450edef68
2010-05-18 16:52:48 +00:00
Bryan Duxbury
7173bd96bd THRIFT-646. erl: Erlang library is missing install target
This patch adds a new install target to the erlang makefile. It also converts the Makefile to Makefile.am

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940326 13f79535-47bb-0310-9956-ffa450edef68
2010-05-02 22:54:22 +00:00
Todd Lipcon
53ae9f39d5 THRIFT-622. Add appropriate licensing information to get Thrift ready for a release.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@887812 13f79535-47bb-0310-9956-ffa450edef68
2009-12-07 00:42:38 +00:00
David Reiss
b42361c2e9 THRIFT-574. erlang: Support framed transport for servers
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@813054 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09 17:18:57 +00:00
David Reiss
1e1a697672 THRIFT-211. erlang: Support "tethered" clients
Add a client option that causes clients to monitor their creators
and terminate when the creator dies.  This makes it possible to
prevent client leaks without linking, because the latter causes
application code to be killed when a transport error occurs and
exits are not trapped.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781636 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 02:01:32 +00:00
David Reiss
bb97fd90a5 THRIFT-211. erlang: Allow clients to be created without connecting
Add a client option to prevent the initial connect (which causes
the protocol factory to be ignored).  The main use case for this
is testing the proper handling of clients that cannot connect.
Update the tether test to use this feature instead of a raw
gen_server:start call.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781635 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 02:01:28 +00:00
David Reiss
5e530af587 THRIFT-211. erlang: Support unlinked Thrift clients.
- Create a thrift_client:start function that accepts client options.
- Make start_link a wrapper that adds {monitor, link}.
- Add a test to make sure that everything dies or doesn't die as expected.
  (The test has to be run manually.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781634 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 02:01:24 +00:00