Summary: Otherwise, readMessageEnd will be performed twice; once in the extension and once in PHP-land. Since TBinaryProtocol readMessageEnd is a no-op this isn't a huge deal, but it's bad style.
Reviewed By: mcslee
Test Plan: Inspect generated php code
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 9155
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665567 13f79535-47bb-0310-9956-ffa450edef68
Summary: The convert_to_*_ex functions were being used improperly resulting
in heap corruption in some cases; I just switched everything over to the
non-ex versions since it shouldn't matter if I modify the value being
serialized in place to coerce it to the proper type.
Also fixed a potential crash for map, set, and list types when not passed
an array, by first attempting an array conversion and then throwing a
tprotocolexception if that doesn't succeed. (Actually, PHP might fatal there
instead, it wasn't immediately clear from reading the code if that would
be the case).
Reviewed by: marcel
Test plan: Ran under php-5.2.5, debug and release builds. No more heap corruption
or memory leak complaints (the latter also a side effect of undesired zval
reference separation).
Revert: only if you love SIGSEGV
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665566 13f79535-47bb-0310-9956-ffa450edef68
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
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
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
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
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
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
- 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
- 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
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
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
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
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
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
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
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
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
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