Commit Graph

974 Commits

Author SHA1 Message Date
David Reiss
33fc5adb2b Check for ptrdiff_t and fail if we don't have it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665682 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 07:17:34 +00:00
David Reiss
80097936bd C++/TFramedTransport: Don't write an empty frame on flush.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665681 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 07:14:10 +00:00
David Reiss
4771458432 Fix a small logic error in TBufferedTransport::borrowSlow.
Was using an unsigned int for a value that could be negative.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665680 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 00:40:26 +00:00
David Reiss
8df6c82aa7 Switch md5 implementations.
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
2008-05-04 03:00:22 +00:00
David Reiss
de59292f38 Remove an unnecessary include of boost/lexical_cast.hpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665678 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 20:51:03 +00:00
David Reiss
f233e46a2d Throw a transport exception if fstat fails.
This was failing on an NFS mount that was dying.
Better to fail hard then return uninitialized data.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665677 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 06:21:04 +00:00
David Reiss
28f298dd5d Memory-based transport rewrite.
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
2008-05-01 06:17:36 +00:00
David Reiss
9a4edfa07f Properly handle constants of typedef'ed types.
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
2008-05-01 05:52:50 +00:00
David Reiss
372126079c Eliminate an unused local variable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665674 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:49 +00:00
David Reiss
e39e937911 Remove a few unnecessary includes to speed up compiles.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665673 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:48 +00:00
David Reiss
6412000143 C++: Make write{Struct,Field}Begin take "name" as a const char*.
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
2008-04-29 23:12:24 +00:00
David Reiss
74672b6719 Java: In toString for generated structs, handle nulls.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665671 13f79535-47bb-0310-9956-ffa450edef68
2008-04-29 23:09:11 +00:00
David Reiss
051fbd4e57 Thrift REST parsing allows null object params
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
2008-04-29 00:29:45 +00:00
David Reiss
c17fe6b918 THRIFT: Nonblcoking bug fix
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
2008-04-29 00:29:43 +00:00
David Reiss
1997f10e28 Persistent conns in TSocketPool
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
2008-04-29 00:29:41 +00:00
David Reiss
81c7fc01bf Add a missing include to Benchmark.cpp to make it build on Mac OS.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665667 13f79535-47bb-0310-9956-ffa450edef68
2008-04-28 02:51:44 +00:00
David Reiss
bd3b168e63 Silence a valgrind complaint by matching "delete[]" with "new[]".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665666 13f79535-47bb-0310-9956-ffa450edef68
2008-04-28 02:42:28 +00:00
David Reiss
10a22bf1f6 Version bump to 20080411.
Also updated CONTRIBUTORS and NEWS.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665665 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:08:07 +00:00
David Reiss
c8abb0733f Add build.xml, src, and LICENSE to EXTRA_DIST in lib/java/Makefile.am.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665664 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:08:01 +00:00
David Reiss
94058454a0 Add TBase64Utils.h and TJSONProto.h to lib/cpp/Makefile.am.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665663 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:58 +00:00
David Reiss
d80c06a1a1 Add contrib to EXTRA_DIST so it goes into make dist.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665662 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:53 +00:00
David Reiss
13c4380347 Add a distdir rule to lib/erl/Makefile to make "make check" happy.
This is a gross hack because lib/erl isn't using automake,
but it is still in SUBDIRs.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665661 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:49 +00:00
David Reiss
847a294b4e Check for ssize_t in configure.ac.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665660 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:43 +00:00
David Reiss
0ff213741c Delete a crazy line from fb303's build.xml.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665659 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 05:28:14 +00:00
David Reiss
2724c7a311 Thrift: bug fix for interrupting server socket
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
2008-04-18 17:48:03 +00:00
David Reiss
739cbe2b86 Add a few missing includes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665657 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 05:44:00 +00:00
David Reiss
a177109752 Fix Thrift.cpp for non-Linux systems.
- 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
2008-04-11 22:36:31 +00:00
David Reiss
1d106ae6f0 Add simple "check" and "distclean" targets to lib/erl/Makefile.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665655 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 22:00:06 +00:00
David Reiss
99f193766f Remove some .pyc files from fb303.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665654 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 22:00:00 +00:00
David Reiss
2a9d6696d0 Whitespace change for consistency.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665653 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 21:59:45 +00:00
dweatherford
e4dc4f5366 [thrift] Propogate exceptions from transports in thrift_protocol extension
Summary: Otherwise, it will spin forever if your socket connection gets dropped
  or otherwise times out.
Reviewed by: dbraginsky
Test plan: Modified TSocket to always throw an exception on read() and tried
  some service calls
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665652 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 02:51:44 +00:00
iproctor
8361bf0565 ocaml and haskell thrift clients now calling readMessageEnd
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
2008-04-10 00:31:55 +00:00
David Reiss
b54deb1ca5 Fix a minor bug in TDebugProtocol and remove dead code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665650 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 19:38:49 +00:00
David Reiss
1677ac9cc7 Use poll instead of select in TServerSocket
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
2008-04-08 06:26:27 +00:00
David Reiss
9b20955b2d Thrift error logging improvements
Summary: - Move strerror_s to Thrift.h (was previously in TTransportException.h)
         - Capture errno as soon as syscall returns failure and make it part of error message.
         - Cleaned up several instances of the wrong error value being printed.
         - More consistently pass the errno in the TTransport Exception
         - Add more consistent error logging for the various transport failure modes

Reviewed By: dreiss

Test Plan: - compile everything.
           - test on search tier

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 11077


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665648 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 06:26:05 +00:00
David Reiss
22b1886dc7 use poll instead of select in TSocket
Summary: fd_set, which we pass into select only supports  fds with values < 1024.
         fds can be >= 1024.
         this can cause memory corruption

         learning this stuff over 2 weeks of examining crazy core dumps is way more fun that reading it up somewhere.

         poll takes an array of fds insetad, so your fd can be any int

Reviewed By: dreiss

Test Plan: ran inside a test search cluster

Revert: OK

DiffCamp Revision: 10731


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665647 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 06:25:45 +00:00
David Reiss
1ffb61beaa Fix a bug in TPipedTransport that broke pipelining.
Previously, TPipedTransport wrote it's full buffer to the "pipe" and
fully reset its buffer on a readEnd.  This assumed that the buffer was
fully read at that point.  This is not the case if requests are pipelined.
This change makes it only pipe out the portion that has been read and
copy the unread portion to the beginning of the buffer.

Also add a test that verifies the new functionality.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665646 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:07:26 +00:00
David Reiss
bbdb06eb24 Add thrift_dump.cpp to contrib.
thrift_dump is a simple program for converting data from TBinaryProtocol to
TDebugProtocol.  Throw it in contrib because it is pretty primitve.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665645 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:07:14 +00:00
David Reiss
e4db03d110 Add TFDTransport: a dead-simple wrapper around a file-descriptor.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665644 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:06:59 +00:00
David Reiss
e0e3d1b232 Add TProtocolTap: a meta-protocol for "wiretapping".
TProtocolTap is a protocol that passes reads through to a "source" protocol,
but mirrors them as writes to a "sink" protocol.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665643 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:06:45 +00:00
David Reiss
642f2d3fbe TDebugProtocol: Add support for messages.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665642 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:06:32 +00:00
David Reiss
a80f0fb47a TDebugProtocol: Support a limit on string length.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665641 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:06:15 +00:00
David Reiss
2a4bfd6d0c Clean up the unit tests.
- Make Python tests cwd-agnostic.
- Use boost::test.
- Add a benchmark.
- Use a library to clean up test/Makefile.am.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665640 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 23:45:00 +00:00
David Reiss
c5c542538b Fix some indentation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665639 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 23:16:46 +00:00
David Reiss
e9aab10d85 Remove sigplanconf.cls and thrift.pdf.
The license for the cls file is unclear, and the formatted pdf file is
a derivative work.  Therefore, it is probably not safe for us to leave
these in the source tree once we go into Apache.

Also put a reference to the source of the cls file in thrift.tex.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665638 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:53 +00:00
David Reiss
1dd17f5a53 Update OCamlMakefile to the latest version and include its README.
Updating isn't really necessary, I just wanted to be 100% that I had
the right version of the README for the version of the Makefile we had.
The main reason for including the README is to make the license clear.

Reviewed By: iproctor


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665637 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:45 +00:00
David Reiss
04c6267aba Squelch most Java 1.6 warnings.
I actualy wasn't able to test this with Java 1.5.
Hopefully it doesn't break anything.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665636 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:28 +00:00
David Reiss
c631e98cad Moved the java libraries from src to src/com/facebook/thrift.
Apparently this is what all the Java kids are doing these days.
Ran ant in lib/java and it built fine.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665635 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:10 +00:00
pwyckoff
99b000b484 add fb303 to thrift contrib
Summary: Add clean version of fb303 to thrift contrib readying for open sourcing scribe

Reviewed By: dreiss

Test Plan: bootstrap.sh, make, make install on a fresh machine and then try compiling and running scribe open source version.

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 10841


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665634 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 19:30:55 +00:00
David Reiss
3095aa1843 Add a test client and server for C#.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665633 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 22:10:17 +00:00