TProtocol::readBool expects a "bool&" as its argument, but "list<bool>"
is implemented as "vector<bool>", which is a specialization of vector
that uses a custom structure as its reference type. Therefore, we need
to overload TProtocol::readBool for std::vector<bool>::reference.
This function is provided as a non-virtual for efficiency since it is
highly unlikely that any subclass will want to override it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743112 13f79535-47bb-0310-9956-ffa450edef68
This was a feature designed to allow a Thrift server to report
information about its interface. However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good. Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
id_t is defined in some OSX header, and the id_t in this function
resolved to that one instead of Thread::id_t. This change fully
qualifies the type to make sure it resolves properly.
Also remove a comment about eliminating the C-style cast, since it
is actually quite appropriate in this case.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722337 13f79535-47bb-0310-9956-ffa450edef68
Previously, TBufferedTransport and TFramedTransport could
leave data in their buffers if a flush threw an exception.
This patch makes them reset their internal pointers before
flushing to the underlying transport.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709037 13f79535-47bb-0310-9956-ffa450edef68
This function didn't work properly when used outside of the Thrift library
because config.h isn't available. This patch fixes the issue by moving
the function definition into the library.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675819 13f79535-47bb-0310-9956-ffa450edef68
TNonblockingServer and TFramedTransport used to have the option to only
frame messages on one side of the communication. This capability was
removed from TFramedTransport because it was poorly implemented and not
useful. This change removes it from TNonblockingServer as well, and
removes references to it in some of the C++ test code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673791 13f79535-47bb-0310-9956-ffa450edef68
Instead of doing one 4-byte write for the frame length before the write
of the actual message, prepend the frame length to the message buffer
so we can send them both at once.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672937 13f79535-47bb-0310-9956-ffa450edef68
We don't want to include pthread.h in Mutex.h, so we can't detect whether
the non-portable mutex initializers are defined. Instead, we just declare
them unconditionally and only define them if they are available.
Unfortunately, this means that users will get a link error instead of a
compile error if they try to use them when they are not available.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666495 13f79535-47bb-0310-9956-ffa450edef68
- Clean up lib/cpp/Makefile.am to use AM_CXXFLAGS etc instead of
target-specific so we can take advantage of default flags.
- Use top_builddir in a few places instead of top_srcdir.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666489 13f79535-47bb-0310-9956-ffa450edef68
On FreeBSD (and possibly other BSDs), binding to ipv6 is restricted unless the
sysctl net.inet6.ip6.v6only=0 or the socket option IPV6_V6ONLY is turned off.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666367 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Add an argument to the Mutex constructor.
It takes a pointer to a function that initializes the internal pthread_mutex_t.
We provide initializers for default pthread_mutex_t (which is our default),
adaptive mutexes, and recursive mutexes.
Reviewed By: hzhao, psaab, mcslee
Test Plan: Built libthrift.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666362 13f79535-47bb-0310-9956-ffa450edef68
Adds an #ifdef'd block that calls ProfilerRegisterThread() if
"REGISTER_THREAD_GOOGLE_PERFTOOLS" is set. Apparently, this makes the
Google perftools CPU profiler work much better on x86-64.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666358 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
Summary:
These methods previously took name as a const string&. While that way
is more idiomatic, it requires a temporary string to be constructed
when we pass a string literal (which is always). This was significantly
slowing down the serialization of field-heavy structures. This change
will break ABI compatibility, but the serialization speed boost with
no external API changes is too important to pass up.
Reviewed By: mcslee, aditya
Test Plan: make check
TracCamp Project: Thrift
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665672 13f79535-47bb-0310-9956-ffa450edef68
calling decrement with -1 even though param is an integer. Just made it clean by adding a decrement function
reviewed by: mcslee
revertable
test plan: ran on a test server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665669 13f79535-47bb-0310-9956-ffa450edef68
Summary: Added support for persistent conns in TSocketPool
Also, added some util functions in TNonblockingServer
Reviewed By: mcslee
Test Plan: Ran a test search cluster with these changes - open was only called once (I put fprintfs in open and close), after which the socket was reused
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 11425
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665668 13f79535-47bb-0310-9956-ffa450edef68
Summary: TServerSocket uses a socket pair to signal interruption to the select() call on its main server socket. A bug in the code prevented the select() from listening for events on the internal socket pair; in fact, it was accidentally listening to file descriptor 1.
Reviewed By: aditya
Test Plan: Use a server that supports a call to shutdown, which should signal an interrupt to the internal socket, and should result in an immediate and clean termination of the server socket thread.
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 11932
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665658 13f79535-47bb-0310-9956-ffa450edef68
- Add some missing namespace qualifiers that are not used in the glibc case.
- Move an include from Thrift.h to Thrift.cpp.
- Include boost/lexical_cast.hpp in TJSONProtocol, in case we ever eliminate
it from our header files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665656 13f79535-47bb-0310-9956-ffa450edef68
Summary: - select has a restricted max fd set size. While this should not be an issue in the normal case for
TServerSocket because it is started when the process starts, it could be a problem if someone wanted
to start a new server socket at a later point in time when socket values could be greater than max.
Reviewed By: dreiss
Test Plan: - Compiled.
- Deployed search tier and made sure it could serve queries.
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 11076
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665649 13f79535-47bb-0310-9956-ffa450edef68