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
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
Reviewed By: cpiro
Test Plan: ran a server ... verified its debug messages no longer included
hostnames
Notes: methinks this binding is not long for this world
Revert Plan: sure ... if you don't like your dns server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665505 13f79535-47bb-0310-9956-ffa450edef68
Summary: default socket send timeout to 5seconds, not infinity.
close the socket in case of an error.
Reviewed By: cpiro
Test Plan: ran a client for slow services
and sanity checked other client code to make sure
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665504 13f79535-47bb-0310-9956-ffa450edef68
Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as
o = ThriftObject.new :field1 => value1, :field2 => value2, ...
are supported as before, and the string form,
o = ThriftObject.new "field1" => value1, "field2" => value2, ...
disabled by the previous patch now also works.
Placing this code in the module is also just a cleaner solution.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Redefining an Automake rule totally blows away anything Automake puts in place.
By using all-local instead of all, we can just add to the generated rule.
Reviewed By: marc
Test Plan: make
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665499 13f79535-47bb-0310-9956-ffa450edef68
Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".
Reviewed By: marc
Test Plan: make clean
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Python and Java versions of "make check" only work if "make all" has
been run. Our automake-fu isn't strong enough to make proper dependencies,
so this hack suggested by Nitay will force the libraries to be built
before make check is run.
Test Plan: make check
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665497 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Chad Walters is developing a full-featured JSON-based protocol for Java,
so we're renaming the existing protocol to something more descriptive.
I also edited the file to rename the class and add to the header comment.
I have no idea if Subversion does explicit rename tracking, or if
git svn is smart enough to mark renames as such, but I would predict
"yes" to both. Let's find out.
Reviewed By: mcslee, jssarma
Test Plan: Ran "ant" in lib/java
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665492 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Added a LookaheadReader to the TJSONProtocol so it doesn't have to
rely on the transport to borrow.
Also added a check to a corner case and fixed up some comments and whitespace.
Reviewed By: mcslee
Test Plan: make check
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665491 13f79535-47bb-0310-9956-ffa450edef68
Summary: before it would complain and not exit. that's not right.
Reviewed By: eletuchy
Test Plan: DEATH ENSUES
Revert Plan: sounds reasonable
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665490 13f79535-47bb-0310-9956-ffa450edef68
Summary:
There were a few places where we were calling malloc/reallaoc/free without
including cstdlib (or stdlib.h). This is broken, but it worked because
other headers that we were including included stdlib.h. However, on a
platform where this wasn't true, it broke the Thrift build. This change
adds the proper includes. It also changes malloc to std::malloc (same
with realloc and free) in a few places, because that is the correct way
of doing it when you include cstdlib.
Reviewed By: mcslee
Test Plan: Compiled Thrift.
Revert Plan: ok
Other Notes:
This bug was noticed by a Thrudb user, and the patch was sent in by
Ross McFarland.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665487 13f79535-47bb-0310-9956-ffa450edef68
Summary:
This change adds a new and exciting protocol to Thrift. It uses
RFC-compliant JSON as the wire protocol and is fully human readable.
(once a little whitespace has been inserted.) Unlike the existing
JSON protocol for Java, which is intended to allow Thrift data to be
transferred to scripting languages, this protocol is lossless and fully
read-write. It was written by Chad Walters of Powerset and reviewed
by David Reiss.
Tested by running make check.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665482 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The upcoming TJSONProtocol handles string and binary types quite differently.
This change makes that distinction in all parts of the C++ binding.
Java already distinguished between string and binary, but this change
also updates the Java skip method to skip over strings as binary
so we don't get encoding errors when skipping binary data.
Reviewed By: mcslee
Test Plan: make check
Revert Plan: ok
Other Notes:
I just pulled this out of Chad Walters' JSON patch.
The only other change was adding readBinary (or was it writeBinary)
to TDenseProtocol. Maybe inheriting from TBinaryProtocol wasn't a good idea.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665481 13f79535-47bb-0310-9956-ffa450edef68
Summary: calls integer_to_list on the port
Reviewed By: dreiss
Test Plan: connected a client to non-running server. oh noes, exception.
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665475 13f79535-47bb-0310-9956-ffa450edef68
Summary: getTransport is now a method of Protocol. To flush the transport one does tflush (getTransport p) instead of pflush p. This is more like how it is done with other languages.
Reviewed By: dcorson
Test Plan: Ran thrifttest for haskell.
Revert: OK
DiffCamp Revision: 7515
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665473 13f79535-47bb-0310-9956-ffa450edef68
Summary: Use comment trick in params that are unused to prevent warnings
Reviewed By: dreiss
Test Plan: Generate C++ code and compile -W -Wall
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665469 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.
Reviewed By: mcslee
Test Plan: git diff -b
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Installed Mono and built it.
Revert Plan: ok
Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665465 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Built it after a future revision.
Revert Plan: ok
Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665464 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Built it after a future revision.
Revert Plan: ok
Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665463 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Some member variables were actually being treated as local variables.
Reviewed By: mcslee
Test Plan: None.
Revert Plan: ok
Other Notes:
Actually reviewed by Kevin Clark.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665462 13f79535-47bb-0310-9956-ffa450edef68
Summary:
There were some weird cases where the implicit conversion from
const char* to std::string was causing the wrong constructor to be called.
There wasn't really a clean workaround, so we're dropping the string
constructors.
Reviewed By: mcslee
Test Plan:
Ran the test.
Grepped around the /projects tree for uses that had to fixed,
and fixed them.
Revert Plan: ok
Other Notes:
This risk was pointed out by Ben Maurer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665461 13f79535-47bb-0310-9956-ffa450edef68
Summary:
This didn't get updated when the interface changed,
and the cast silenced the warning message. Stupid C.
Reviewed By: mcslee
Test Plan: Trust Chad Walters.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665457 13f79535-47bb-0310-9956-ffa450edef68
Chad Walters is writing a JSON protocol for Thrift, but he wants
borrow to always succeed. That would be a pain to implement,
but here is a first step: borrow will almost always work with
TBufferedTransport.
Reviewed by: mcslee
Test Plan: Ran the DenseProtocol test and Zlib test, but more needs to be done.
Other Notes:
Also reviewed by Chad Walters, and maybe Ben Maurer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665455 13f79535-47bb-0310-9956-ffa450edef68
Summary:
I don't know what I was thinking when I first wrote this.
It makes sense that the transport might not want to allocate its own memory,
so the protocol is expected to provide a buffer for the data.
However, if the transport already has the data buffered,
there is no need to memcpy it; it can just return a pointer into its buffer.
The new interface still requires the protocol to provide a buffer,
but allows the transport to return a pointer to an interal buffer.
In addition, I made len a pass-by-pointer parameter so that
the transport can return more than the requested data if it has it
available in its buffers.
Reviewed By: mcslee
Test Plan: Ran the DenseProtocol test and the Zlib test.
Revert Plan: ok
Other Notes:
Also got this reviewed by Chad Walters from Powerset.
Ben Maurer suggested making len a reference parameter.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665454 13f79535-47bb-0310-9956-ffa450edef68
Summary: three related changes:
* for numeric types in tBinaryProtocol call effectful_write with binary(), not [char()]
* tBinaryProtocol:writeString now takes either [char()], iolist(), or binary() ... now you can use any of the three where a Thrift string is required
* tBufferedTransport now buffers by building an iolist() rather than Buffer++Data. zomg.
Reviewed By: eletuchy
Test Plan: everything seems to work as usual, and binary() works as expected
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665447 13f79535-47bb-0310-9956-ffa450edef68
Summary: They both use the same handler for all connections and thus assume the handler is thread-safe. The TThreadPoolServer preserves threads, so it wouldn't be too hard to make a variant that used a separate handler for each thread and thus didn't require thread safety.
Reviewed By: mcslee
Test Plan: loads without error
Revert Plan: ok
Other Notes: contributed by William Morgan (w@adap.tv)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665438 13f79535-47bb-0310-9956-ffa450edef68
Summary: Change the default to Executors.newCachedThreadPool() which is a good default and basically what we should always want.
Reviewed By: dreiss
Test Plan: Run a Java server with default args
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665424 13f79535-47bb-0310-9956-ffa450edef68
Summary: this gets rid of a lot of messy useless output every time the error logger prints something
Reviewed By: eletuchy
Test Plan: works as expected
Revert Plan: ok
Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665422 13f79535-47bb-0310-9956-ffa450edef68
Summary:
C# generator, library, and MS Build task contributed by imeem.
Reviewed By: mcslee
Test Plan:
Built the Thrift compiler and generated some C# code.
I'd love to say I installed Mono or Portable.NET and built the C# code,
but I did not.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665421 13f79535-47bb-0310-9956-ffa450edef68
Summary: Read the documentation on ThreadPoolExecutor. It's very confusing. Basically, what we want is a queue that always defers to the threadpool and will always create a new thread to do work. We never want the queue to take priority over the thread pool by default.
Reviewed By: dreiss
Test Plan: Run a Java Thrift server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665419 13f79535-47bb-0310-9956-ffa450edef68