- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.
I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work. However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
The version is determined by configure.ac. After this version is shown the
revision. For subversion, it is simply the current revision as given by
`svnversion`. For git, the latest svn revision that HEAD includes is shown,
followed by the offset of HEAD from that commit, followed by a truncated sha1
for HEAD. If the offset is 0, the offset and sha1 are omitted.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672900 13f79535-47bb-0310-9956-ffa450edef68
This fixes a bug where thrift_client would return a tuple rather than a tagged record when the called function returned a struct.
Test plan:
in tutorial client:
Log: {sharedStruct,1,<<"RARG">>}
instead of:
Log: {1,<<"RARG">>}
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666482 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:
- 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
- Exceptions don't work yet, but it looks like everything else does.
- Seems to work fine on our pricing service
- Code could need some cleanup
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666377 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Previously, if you set a structure field to, say, an int when it was
supposed to be a container (array) or struct (object), the serialization
code would either produce corrupt output (container) or cause a fatal
error (struct). Now they both throw exceptions.
Reviewed By: mcslee
Test Plan: Looked at generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666365 13f79535-47bb-0310-9956-ffa450edef68
Specifically, switch from the legally-ambiguous RSA implementation to
a zlib-licensed RFC-based implementation from SourceForge.
Generated some files with "dense" and made sure the output hadn't changed.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665679 13f79535-47bb-0310-9956-ffa450edef68
The old implementations of the memory-based transports (TBufferedTransport,
TFramedTransport, and TMemoryBuffer) shared very little code and all worked
a bit differently. This change unifies them all as subclasses of a single
base (TBufferBase) which handles the fast-path operations (when requests
can be satisfied by the buffer) with inline methods (that will eventually
be made nonvirtual in the template branch) and calls out to pure-virutal
methods to handle full/empty buffers. All of the buffer-management is now
done in terms of "base and bound" pointers rather than "pos" integers.
These classes were moved to TBufferTransports.{h,cpp}. The .h is included
in TTransportUtils for backwards compatibility.
Also added a "TShortReadTransport" to assist testing transports.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665676 13f79535-47bb-0310-9956-ffa450edef68
Also throw an error in the compiler if we cannot generate a constant for a
declared const because of its type. Added a test of this functionality in
ConstantsDemo.thrift.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665675 13f79535-47bb-0310-9956-ffa450edef68
Summary: If JSON objects are passed in allow them to be null and don'\''t default construct.
Reviewed By: dreiss
Test Plan: Regenerate API code and test on object args.
Revert: OK
DiffCamp Revision: 12407
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665670 13f79535-47bb-0310-9956-ffa450edef68
Summary: I neglected to make the call to readMessageEnd if the client read an app exception in the haskell and ocaml code. Fixed now. The test cases for both now also compile with the new ThriftTest.thrift (though haskell's is still not doing anything but echoing the args)
Reviewed By: dreiss
Test Plan: Ran test code. This bug would actually never show up because there's only tbinaryprotocol implemented for these languages and that does nothing on a readMessageEnd.
Revert: OK
DiffCamp Revision: 11377
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665651 13f79535-47bb-0310-9956-ffa450edef68
We weren't initializing our pointers properly, resulting in
a difficult-to-trigger segfault.
Reviewed By: mcslee, bhamadani
Test Plan: Built the modified search IDL.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665627 13f79535-47bb-0310-9956-ffa450edef68
- Make the Perl generator use program->get_namespace("perl")
instead of program->get_perl_package()
- Eliminate the explicit "perl_package" in t_program.
- Deprecate the perl_package token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665624 13f79535-47bb-0310-9956-ffa450edef68