Summary: we need to use a shared_ptr instead of an old fashioned one if we're
going to stick with this PIMPL model
Reviewed By: dreiss, marc
Test Plan: test program didn't fail or leak memory, foreman (fb303 client)
worked without problem
Revert Plan: just make sure you find some other solution to this problem
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665280 13f79535-47bb-0310-9956-ffa450edef68
Summary: also added myself to CONTRIBUTORS.
Reviewed By: marc
Test Plan: the following program no longer leaks memory (valgrind):
int main(int argc, char **argv){
Mutex mu;
mu.lock();
mu.unlock();
}
Revert Plan: ok
Notes: this is kind of important
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665279 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- make dist is no fun. Had to add a lot of stuff to Makefile.am to
make sure stuff got included in the tarball.
- Added a permanent NEWS file with the release notes for this release.
- clean.sh removes ylwrap also.
- Gave it a real version for make dist.
- Added ACLOCAL_AMFLAGS to lib/cpp/Makefile.am to make it easier to
work on configure.ac.
- Made concurrency_test a non-installed binary because
no one wants to install it.
- Dropped some symlinks that were annoying make dist.
- Updated README.
Test Plan:
./bootstrap.sh && ./configure && make dist
Compared contents of tarball to source tree.
Did this from a fresh git tree so no gross untracked files would be around.
On devrs: ./bootstrap.sh && ./configure && make install DESTDIR=/tmp/relinst1
Made sure concurrency_test was built but not installed.
Checked zlib URL with firefox.
Reviewed By: mcslee
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665274 13f79535-47bb-0310-9956-ffa450edef68
Summary:
* got rid of most of the otp_base jonx ... save that for a future release unfortunately
* cleaned up the tutorial server, added -erl to tutorial.thrift's shebang
* made better README and TODO
Test Plan: checked out a copy, read my directions, built and ran the tutorial, and pretended that it didn't blow
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665273 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Same as the last (reverted) zlib patch,
but this time with way more awesome support for building
with no zlib headers installed.
Reviewed By: mcslee
Test Plan:
- Did lots of really pathological stuff in my VMware.
- On devrs004:
./bootstrap.sh && ./configure && make && make install DESTDIR=/tmp/tzinst && echo "Yay"
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665269 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Totally re-did the libevent check.
- Thrift now compiles and instals cleanly without libevent.
- (libevent is still needed to build libthriftnb.)
Reviewed By: mcslee
Test Plan:
- Ran configure and make in various configurations in my VMware.
- Clean build and install of Thrift on devrs004 (into /tmp).
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665267 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Add a new transport to the C++ library: TZLibTransport.
This wraps another transport (just like TBufferedTransport),
compresses the data written to it, and uncompresses the data it reads.
Reviewed By: mcslee
Test Plan:
For ax_lib_zlib.m4
- Ran ./bootstrap.sh.
- Looked at configure.
- Ran ./configure.
- Looked at config.status
- Ran ./configure --with-zlib=/usr.
- Looked at config.status
- Changed configure.ac to AC_LIB_ZLIB(1.2.4)
- Ran ./configure.
- Watched it fail.
For TZlibTransport
- test/ZlibTest.cpp
- Code coverage (hotness) report sent with review.
- 100% line coverage for all the good stuff.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665262 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- TDenseProtocol now includes a part of the struct fingerprint in
the serialized message, to protect from unserialzing trash.
- A lot of cleanups and commenting for TDenseProtocol.
- A lot of test cases for same.
Reviewed By: mcslee
Test Plan: test/DenseProtoTest.cpp
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665257 13f79535-47bb-0310-9956-ffa450edef68
Summary: Thanks to Andrew McGeachie for doing this
Reviewed By: dreiss
Test Plan: No merge/build issues. Will solicit McGeachie for additions to test/cocoa in the future
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665254 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan:
test/DenseProtoTest.cpp
Still have to test:
- Bounds checking.
- borrow/consume on TBuffered and TFramed.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665252 13f79535-47bb-0310-9956-ffa450edef68
Summary:
To support the upcoming variable-length encoding of integers in
TDenseProtocol, augment Thrift transports with two new methods:
borrow and consume. Borrow copies some data out of the transport
without consuming it, and consume... consumes it.
Reviewed By: mcslee
Test Plan:
Thrift compiles.
Should check in variable-length integer code for TDenseProtocol
right after this (git ruulz).
Revert Plan: revert stuff that uses these methods also.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665251 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Python version of TBufferedTransport now uses input buffering.
It is also compatible with the fasbinary module.
Reviewed By: mcslee
Test Plan:
test/FastbinaryTest.py
dreiss@dreiss-vmware:~/gp/thrift/test/py$ strace -f ./TestClient.py 2>&1 | grep recv | wc -l
99
# Install new version in other terminal
dreiss@dreiss-vmware:~/gp/thrift/test/py$ strace -f ./TestClient.py 2>&1 | grep recv | wc -l
14
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665250 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Added the configure script variable PY_PREFIX which serves the same purpose
for Python as --prefix does for C/C++. We chose to do this because Python
has different conventions for where to install libraries.
Reviewed By: mcslee
Test Plan:
Full clean builds and installs of Thrift from the Thrift root,
with and without PY_PREFIX. Watched output of make install.
Ran configure from lib/py without PY_PREFIX, with PY_PREFIX and with
PY_PREFIX in the environment. Checked config.status for each.
Revert Plan: okay
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665248 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Made some stuff in TBinaryProtocol protected instead of private.
- Added a preliminary version of TDenseProtocol. This is still
super highly experimental and gross, and I wrote a super scary
comment to explain that to anyone foolish enough to try to use
this in its current state.
Reviewed By: mcslee
Test Plan: test/DenseProtoTest.cpp
Revert Plan: ok
Memcache Impact:
Save memory if/when people use it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665247 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Local reflection typespecs for structs now have a dummy T_STOP field at the end
so we don't have to check the size on every iteration.
They also contain information about which fields are optional.
Also put a static pointer to the reflection in each structure.
Reviewed By: mcslee
Test Plan: test/DenseLinkingTest.thrift
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665246 13f79535-47bb-0310-9956-ffa450edef68
Also, checking in changes to the php generation code I made awhile ago, but forgot to check in
Reviewed By: aditya, mcslee
Test Plan: Compiled thrift and falcon, and confirmed that falcon's print binary still worked
Revert Plan: revertible
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665245 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- this was causing some bizarre issues with seeking to a particular point in the log
- I can't believe we haven't run into this before
Reviewed By: jwang
Test Plan: replayed log file from a partiicular point
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665242 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The compiler now takes a "-dense" flag that will cause it to
generate some extra metadata for C++. This metadata will be used by
TDenseProtocol. This should be the last compiler change necessary
to enable that feature.
Reviewed By: mcslee
Test Plan: test/DenseLinkingTest.thrift
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665240 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Wrap import of fastbinary in a try/catch, setting it to None if it fails.
- Don't try to fastbinary.encode/decode if fastbinary is None.
- Always generate thrift_spec, even if it is None.
- Don't try to fastbinary.encode/decode if thrift_spec is None.
Reviewed By: mcslee
Test Plan:
test/py/Test{Client,Server}.py
Manually delete my fastbinary.so, they worked fine.
Changed them to use Accelerated protocol. They still worked fine because
the test falls through to the normal generated code.
Installed fastbinary.so, everything worked fine (eventually).
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665236 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Give reflection_limited a nice clean Python module.
- if/regen.sh now generates reflection_limited for Python and copies it to src.
- Added the generated Python for reflection_limited to version control.
- lib/py/setup.py installs reflection_limited.
- lib/py/cleanup.sh now removes build (make sure to run as root).
- The C++ version of reflection_limited was also updated by regen.sh.
Reviewed By: mcslee
Test Plan:
- Clean build and install.
- Look at the installed Python files.
- python -c 'from thrift.reflection.limited.ttypes import *'
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665235 13f79535-47bb-0310-9956-ffa450edef68
Summary:
It seems like the Python convention is that random janky libraries
are installed in /usr/lib/pythonX.Y/site-packages. This patch follows
that convention, even though it is pretty gross to ignore --prefix.
Reviewed By: mcslee
Test Plan: make install thrift python libs on my box.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665233 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Thrift compiler now generates static methods for every service to generate
a reflection of the methods provided by the service. This reflection is fairly
limited, but should be enough for what we want to do with SMC.
Reviewed By: mcslee
Test Plan: test/ReflectionTest.cpp
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665226 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The recently committed fastbinary.c doesn't compile with Python 2.4.
This version does.
Blame Rev: 56816
Reviewed By: mcslee
Test Plan: make install on devrs004
Revert Plan: Do 56816 also.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665225 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Merging a patch from Ben Maurer.
This adds a python extension (i.e., a C module) that
encodes Python thrift structs into the standard binary protocol
much faster than our generated Python code.
Also added by-value equality comparison to thrift structs
(to help with testing).
Cleaned up some trailing whitespace too.
Reviewed By: mcslee, dreiss
Test Plan:
Recompiled Thrift.
Thrifted a bunch of IDLs and compared the generated Python output.
Looked at the extension module a lot.
test/FastBinaryTest.py
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665224 13f79535-47bb-0310-9956-ffa450edef68
(This change was by Adam, diff sent by email, I'm just checking it in.)
Blame Rev: 55988
Reviewed By: adam
Test Plan: Thrift compiles.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665219 13f79535-47bb-0310-9956-ffa450edef68
Summary:
using namespace XXX; is tricky because it imports a lot of crap into your namespace.
Also, if we ever decide to remove boost as a dependency, "using namespace boost"
makes it harder.
This patch removes all using namesapce XXX; with one or more using XXX::YYY;
There are some exceptions, such as test, tutorial, namespace std, and
facebook namespaces.
Reviewed By: mcslee
Test Plan:
Recompiled thrift.
grep --binary-files=without-match -r 'using namespace' . | \
egrep -v '^[^:]*: *using namespace (std;$|facebook)' | \
grep -v '<< endl' | \
grep -v '[^:]*/tutorial/' | \
grep -v '^./test/'
Revert Plan: ok
Notes: I wouldn't bother, but it is fixathon.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665218 13f79535-47bb-0310-9956-ffa450edef68
Summary: If using TNonBlockingServer with a ThreadManager, when you send a task off to the threadmanager you need to cancel the event that you have set on that client socket. Otherwise, when you give control back to libevent, it might trigger more read events if there are more requests coming down the pipe. This is an issue, because the server will be in the wrong state at that point and will have no way of handling reading more data if it is still in the WAIT_TASK state trying to see if it should write something back to the client. So, when we hit that control flow, we must setIdle() on the TConnection so that libevent doesn't trigger it anymore. Later, after the result is written, we'll setRead() and go back to the init state.
Reviewed By: akhil
Test Plan: Akhil's async + TNonBlocking karma server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665217 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Boz is using TMemoryBuffer by constructing it will a NULL buffer,
then doing a resetBuffer later. This patch re-enables that.
Blame Rev: 55988
Reviewed By: aditya
Test Plan:
Thrift compiles.
Will test feed after this is comitted.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665216 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Someone thought it would be a good idea to have two different signatures
for strerror_r, with subtly different semantics (strlcpy = smart).
We now work properly with either of them.
Also fixed a test to work on 32-bit, you sloppy <expletive>s.
Reviewed By: mcslee
Test Plan:
Rebuild thrift.
Force one of these errors to be thrown.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665215 13f79535-47bb-0310-9956-ffa450edef68
Summary:
TMemoryBuffer already has the necessary plubming to work with C++ strings.
This revision implements that functionality with a few wrapper methods.
Removed TStringBuffer as it should no longer be required (and it is tricky
to safely inherit from a class that has a non-virtual destructor).
Also refactored the TMemoryBuffer constructors a bit.
Reviewed By: aditya, yunfang
Test Plan:
test/TMemoryBufferTest.cpp
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665213 13f79535-47bb-0310-9956-ffa450edef68
Summary: reinterpret_cast actually breaks on linux, despite working on FreeBSD
Reviewed By: dreiss
Test Plan: Compile on Linux OR FreeBSD
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665211 13f79535-47bb-0310-9956-ffa450edef68
Summary:
/**
* A string buffer is a tranpsort that simply reads from and writes to a
* string. Anytime you call write on it, the data is serialized
* into the underlying buffer, you can call getString() to get the serialized
* string. Before you call read, you should call resetString(data) to set the
* underlying buffer, you can then call read to get the
* de-serialized data structure.
*
* The string buffer is inherited from the memory buffer
* Thus, buffers are allocated using C constructs malloc,realloc, and the size
* doubles as necessary.
*/
Reviewed by: aditya
Test Plan:
int main(int argc, char** argv) {
shared_ptr<TStringBuffer> strBuffer(new TStringBuffer());
shared_ptr<TBinaryProtocol> binaryProtcol(new TBinaryProtocol(strBuffer));
testStruct a;
a.i1 = 10;
a.i2 = 30;
a.s1 = string("holla back a");
a.write(binaryProtcol.get());
string serialized = strBuffer->getString();
shared_ptr<TStringBuffer> strBuffer2(new TStringBuffer());
shared_ptr<TBinaryProtocol> binaryProtcol2(new TBinaryProtocol(strBuffer2));
strBuffer2->resetString(serialized);
testStruct a2;
a2.read(binaryProtcol2.get());
if (a == a2) {
printf("serialization working\n");
} else {
printf("serialization not working\n");
}
}
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665209 13f79535-47bb-0310-9956-ffa450edef68