Summary: a failure in thrift_client:init would cause the invoker to exit, but we'd rather just return {error, Error} from start_link and let the invoker crash if it wants
Reviewed By: eletuchy
Test Plan: makes mouths happy
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666450 13f79535-47bb-0310-9956-ffa450edef68
- thrift_client now takes as its fourth parameter Options: framed, strict_{read,write}, connect_timeout (P.S. fourth param used to be Timeout)
- binary protocol now takes options: strict_{read,write}
- buffers in framed and buffered transport are now iolists and not reversed lists of binaries
- rename buffer in buffered transport "write_buffer" to match framed transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666447 13f79535-47bb-0310-9956-ffa450edef68
Summary: will fail ungracefully if the timeout is hit, or anything bad happens. will fix.
Reviewed By: eletuchy
Test Plan: did some stuff with it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666443 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: eletuchy
Notes: the thrift_buffered_transport exits with {normal,{gen_server,call,[Pid,close]}} right now, but it should only exit with normal. marked todo.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666439 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Was leaking processes when the client cleanly disconnected since the
thrift_processor process was exiting with 'normal' Reason. Changed it
to 'protocol_closed'
Test plan:
- Telnet to thrift service port and close (^]close) before the read timeout
elapses. Verify that erlang:system_info(process_count) does not increase
after doing this multiple times.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666430 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Was previously including both the fall-through to the base service as well as the "dummy" fallthrough function clause. This generated a warning like:
gen-erl/redacted_thrift.erl:134: Warning: this clause cannot match because a previous clause at line 132 always matches
Now we only include the "dummy" function if there is no base class to fall through to.
Test plan: Generated tutorial.thrift and shared.thrift, compiled without warnings
Notes: It's probably possible to have a circular inheritance graph, which would cause an infinite loop at runtime. Do we care about this?
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666423 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Throws a 'TApplicationException' record
Test plan:
Changed cpp TestServer so that if testException is called with "ApplicationException" as an argument, it throws a TException which is serialized back as an EXCEPTION type message
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666421 13f79535-47bb-0310-9956-ffa450edef68
Test plan:
f(), {ok, C} = thrift_client:start_link("localhost", 9090, thriftTest_thrift).
thrift_client:call(C, testAsync, [1234]).
thrift_client:call(C, testVoid, []).
thrift_client:call(C, testList, [[1,2,3,4,5]]).
- Should write an actual test suite that exercises all of ThriftTest but I'm lazy right now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666418 13f79535-47bb-0310-9956-ffa450edef68
Test plan: Made testAsync() in test_server always crash with a badmatch 1 = 0,
and made sure that the badmatch was caught and logged but not
serialized back to the client
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666416 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- reply_type for async void functions is now async_void instead of
the empty struct definition
- async void functions should return "ok". otherwise the processor
will crash and the connection will be killed. Is this behaviour
expected?
Test Plan: tested using testAsync() in ThriftTest. Didn't used to work
but works now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666415 13f79535-47bb-0310-9956-ffa450edef68
This fixes a process and file descriptor leak -- previously, the thrift_buffered_transport process was linked to the acceptor, which never died.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666409 13f79535-47bb-0310-9956-ffa450edef68