David Reiss [Thu, 27 Mar 2008 21:40:59 +0000 (21:40 +0000)]
Remove t_cocoa_generator.h.
t_cocoa_generator.h is no longer included anywhere, because
the Cocoa generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665604
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:55 +0000 (21:40 +0000)]
Make the Cocoa generator dynamic.
- Modify the Cocoa generator constructor to fit the new generic interface.
- Register the Cocoa genrator with the central registry.
- Deprecate the old way of invoking the Cocoa generator.
- main.cc no longer includes t_cocoa_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665603
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:52 +0000 (21:40 +0000)]
Put a newline at the end of the generated header file in the Cocoa generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665602
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:46 +0000 (21:40 +0000)]
Make the Smalltalk generator use non-hardcoded namespaces.
- Make the Smalltalk generator use program->get_namespace("smalltalk.*")
instead of program->get_smalltalk_{category|prefix}()
- Eliminate the explicit "smalltalk_{category|prefix}" in t_program.
- Deprecate the smalltalk_{category|prefix} tokens.
- Update example .thrift files and syntax files.
This was a little more complex than the others. We now convert "." to "-"
in Smalltalk categories, because we no longer lex them as tok_st_identifier.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665601
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:42 +0000 (21:40 +0000)]
Allow the Thrift compiler to be built without the Smalltalk generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-st
- Update the compiler Makefile.am to exclude the generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665600
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:38 +0000 (21:40 +0000)]
Remove t_st_generator.h.
t_st_generator.h is no longer included anywhere, because
the Smalltalk generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665599
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:35 +0000 (21:40 +0000)]
Make the Smalltalk generator dynamic.
- Modify the Smalltalk generator constructor to fit the new generic interface.
- Register the Smalltalk genrator with the central registry.
- Deprecate the old way of invoking the Smalltalk generator.
- main.cc no longer includes t_st_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665598
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:30 +0000 (21:40 +0000)]
Make the Smalltalk generator respect the "-o" flag.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665597
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:26 +0000 (21:40 +0000)]
Allow the Thrift compiler to be built without the Haskell generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-hs
- Update the compiler Makefile.am to exclude the generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665596
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:20 +0000 (21:40 +0000)]
Remove t_hs_generator.h.
t_hs_generator.h is no longer included anywhere, because
the Haskell generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665595
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:16 +0000 (21:40 +0000)]
Make the Haskell generator dynamic.
- Modify the Haskell generator constructor to fit the new generic interface.
- Register the Haskell genrator with the central registry.
- Deprecate the old way of invoking the Haskell generator.
- main.cc no longer includes t_hs_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665594
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:11 +0000 (21:40 +0000)]
Allow the Thrift compiler to be built without the OCaml generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-ocaml
- Update the compiler Makefile.am to exclude the generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665593
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:08 +0000 (21:40 +0000)]
Remove t_ocaml_generator.h.
t_ocaml_generator.h is no longer included anywhere, because
the Ocaml generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665592
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:05 +0000 (21:40 +0000)]
Make the OCaml generator dynamic.
- Modify the OCaml generator constructor to fit the new generic interface.
- Register the OCaml genrator with the central registry.
- Deprecate the old way of invoking the OCaml generator.
- main.cc no longer includes t_ocaml_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665591
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:40:01 +0000 (21:40 +0000)]
Make generate_program virtual.
Haskell and OCaml need to override this to put typedefs at the end.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665590
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:39:58 +0000 (21:39 +0000)]
Whitespace-only change for consistency.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665589
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:39:55 +0000 (21:39 +0000)]
Make cleanup.sh work a little better.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665588
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:39:52 +0000 (21:39 +0000)]
Include <cassert> in main.cc.
We are doing an assert in main, but the assert header is being pulled in
by an include that is about to go. Make it explicit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665587
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 21:39:49 +0000 (21:39 +0000)]
Delete code generators after using them.
This has been leaking memory in the compiler, but it has also been
preventing the dynamic generators destructors from being called.
This can prevent a stream from being flushed properly.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665586
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 19:45:24 +0000 (19:45 +0000)]
Fix a bug with Perl's TSocket and THttpClient.
The underlying Perl library expects timeouts in seconds, but the
documentation for the Thrift classes says the should be in milliseconds.
This changes divides timeouts by 1000 to make that the case.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665585
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 27 Mar 2008 19:45:19 +0000 (19:45 +0000)]
Allow nested namespaces to be used in perl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665584
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 26 Mar 2008 07:22:26 +0000 (07:22 +0000)]
Update to the latest version of AX_BOOST_BASE.
It now has the license right in the file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665583
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 25 Mar 2008 18:38:56 +0000 (18:38 +0000)]
Fix some small bugs in the Perl generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665582
13f79535-47bb-0310-9956-
ffa450edef68
dweatherford [Tue, 25 Mar 2008 03:15:10 +0000 (03:15 +0000)]
[thrift] Error checking for T_OBJECT serialization
Summary: Avoid segfaulting via calling zend_fetch_class_entry on something
that might not actually be an object; throw an exception instead.
Reviewed by: shire
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665581
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 21 Mar 2008 21:50:41 +0000 (21:50 +0000)]
Remove an unnecessary "else" from the generated Thrift code.
The "if" block here always results in a return (or an exception),
so there is no need for an "else". We can just put the rest of the code
under the "if" block. This actually makes a little more sense because
the "if" block here is an exceptional case.
Also deleted a stale comment.
Reviewed By: lhastings
Test Plan: diff'ed the old and new code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665580
13f79535-47bb-0310-9956-
ffa450edef68
Christopher Piro [Fri, 21 Mar 2008 00:40:42 +0000 (00:40 +0000)]
[thrift] add setTcp{Send,Recv}Buffer to C++ TSocketServer
Summary: needs moar BDPs
Reviewed By: mcslee
Test Plan: now using in our service
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665579
13f79535-47bb-0310-9956-
ffa450edef68
Mark Slee [Wed, 19 Mar 2008 20:16:35 +0000 (20:16 +0000)]
Fix compiler __construct gen in php
Reviewed By: dreiss
Test Plan: Build payments
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665578
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 19:32:00 +0000 (19:32 +0000)]
Prevent Java's TProtocolUtil.skip from overflowing the stack.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665577
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:22:52 +0000 (18:22 +0000)]
Make the C# build task more robust.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665576
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:22:43 +0000 (18:22 +0000)]
Fixes for the C# library.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665575
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:22:26 +0000 (18:22 +0000)]
Initialize the binary_ field of t_base_type.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665574
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:22:14 +0000 (18:22 +0000)]
Public access to the protocols in C# Thrift clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665573
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:21:58 +0000 (18:21 +0000)]
Some optimizations to the C# generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665572
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 18 Mar 2008 18:21:52 +0000 (18:21 +0000)]
TSocketPool changes
Summary: 1] Added empty constructor
2] Added function to set server list
3] Made getServers return by ref
4] Made list of servers be a list of pointers
The last change is so that someone can pass in the list of servers and rely on TSocketPool to change the failure time directly on the TSocketServer object
Reviewed By: aditya
Test Plan: Ran with a test search server
Revert: OK
DiffCamp Revision: 9529
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665571
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 14 Mar 2008 00:51:42 +0000 (00:51 +0000)]
Don't allow async (no return) functions that throw exceptions.
This wouldn't work anyway. Better to catch it early.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665570
13f79535-47bb-0310-9956-
ffa450edef68
Christopher Piro [Wed, 12 Mar 2008 04:28:43 +0000 (04:28 +0000)]
[thrift] cleanup generated trailing whitespace in php
Summary: Verfolgenplaatze sind verboten!
Reviewed By: kder
Test Plan: no
Revert Plan: yes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665569
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 11 Mar 2008 21:41:47 +0000 (21:41 +0000)]
Add some generated files to .gitignore.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665568
13f79535-47bb-0310-9956-
ffa450edef68
dweatherford [Tue, 11 Mar 2008 02:42:45 +0000 (02:42 +0000)]
[thrift] Move readMessageEnd inside of else block for accelerated protocol
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
dweatherford [Sat, 8 Mar 2008 05:51:24 +0000 (05:51 +0000)]
[thrift] php thrift_protocol crash fixes
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
David Reiss [Fri, 7 Mar 2008 20:28:31 +0000 (20:28 +0000)]
Add an accessor for the I/O protocols of Thrift clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665565
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:28 +0000 (20:12 +0000)]
Remove some trailing whitespace.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665564
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:25 +0000 (20:12 +0000)]
Add .gitignore file.
Ignore all generated files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665563
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:20 +0000 (20:12 +0000)]
Add Java JSON protocol implementation.
Implement full-featured JSON protocol, low-level base-64 encode/decode
methods, and related tests.
Conflicts (resolved by dreiss):
test/java/build.xml
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665562
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:17 +0000 (20:12 +0000)]
Add Java memory buffer transport implementation.
Wraps a TByteArrayOutputStream.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665561
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:13 +0000 (20:12 +0000)]
Add NOT_IMPLEMENTED exception code.
Preparation for Java JSON protocol implementation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665560
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 7 Mar 2008 20:12:07 +0000 (20:12 +0000)]
Add more complete base64 testing for C++ JSON protocol.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665559
13f79535-47bb-0310-9956-
ffa450edef68
dweatherford [Thu, 6 Mar 2008 03:11:08 +0000 (03:11 +0000)]
[thrift] ZTS fixes for thift_protocol extension
Summary: Now the threadsafe build compiles!
Reviewed by: mcslee
Test Plan: compiles, ship it
Revert: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665558
13f79535-47bb-0310-9956-
ffa450edef68
lucas [Wed, 5 Mar 2008 22:04:13 +0000 (22:04 +0000)]
restore tags/1.0.0, we need these at least until fb9 is rolled everywhere
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665557
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 5 Mar 2008 07:51:47 +0000 (07:51 +0000)]
TNonblockingServer: Fix wrong exception names
Reviewed By: dreiss
Test Plan: trivial :)
Revert: OK
DiffCamp Revision: 8789
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665556
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 5 Mar 2008 07:51:44 +0000 (07:51 +0000)]
Thrift: Add writePtr(), wroteBytes() to TMemoryBuffer
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
David Reiss [Wed, 5 Mar 2008 07:51:40 +0000 (07:51 +0000)]
Thrift: concurrency/Util.h: Add converters for 'struct timeval', cleanup
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
David Reiss [Tue, 4 Mar 2008 21:10:41 +0000 (21:10 +0000)]
Change the Java help to be a little more consistent.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665553
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 4 Mar 2008 21:10:38 +0000 (21:10 +0000)]
Don't declare getStaticLimitedReflection if gen_reflection_limited_ is off.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665552
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 4 Mar 2008 21:10:34 +0000 (21:10 +0000)]
Changed an awkward if/else if/else to be slightly less awkward.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665551
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Tue, 4 Mar 2008 21:10:29 +0000 (21:10 +0000)]
Fix a typo in configure.ac.
Used "==" instead of "=" in a test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665550
13f79535-47bb-0310-9956-
ffa450edef68
Christopher Piro [Tue, 4 Mar 2008 07:09:12 +0000 (07:09 +0000)]
[thrift] Erlang build tweaks
Summary: fix the Makefile to use BSD-friendly find(1) and enable conditional building of the Erlang binding. Contributed by Dan Sully (daniel@electricrain.com).
Reviewed By: eletuchy
Test Plan: builds
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665549
13f79535-47bb-0310-9956-
ffa450edef68
dweatherford [Tue, 4 Mar 2008 01:08:23 +0000 (01:08 +0000)]
[thrift] PHP thrift_protocol extension, revision 2.0
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
David Reiss [Sun, 2 Mar 2008 21:59:48 +0000 (21:59 +0000)]
Fix a typo in a warning message in thrifty.yy.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665547
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 07:00:26 +0000 (07:00 +0000)]
Allow the C# library to be excluded from the build.
Use AX_THRIFT_LIB to make configure support --without-csharp.
Don't bother testing for the C# requirements if this is set.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665546
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 07:00:22 +0000 (07:00 +0000)]
Allow the Java library to be excluded from the build.
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
David Reiss [Sun, 2 Mar 2008 07:00:19 +0000 (07:00 +0000)]
Infrastructure for excluding language libraries from the build.
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
David Reiss [Sun, 2 Mar 2008 07:00:15 +0000 (07:00 +0000)]
Make the configure help more consistent.
Make the help strings generated by AX_THRIFT_GEN look more like
the ones from built-in autoconf macros.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665543
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 06:29:23 +0000 (06:29 +0000)]
Generate quality overrides of hashCode for Thrift structs (in Java).
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
David Reiss [Sun, 2 Mar 2008 06:29:19 +0000 (06:29 +0000)]
Add support for .equals() to Java structs.
- 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
David Reiss [Sun, 2 Mar 2008 06:29:16 +0000 (06:29 +0000)]
Add a TDeserializer for Java.
The class is the reverse of TSerializer.
It allows you to deserialize a Thrift struct from a byte array (or String).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665540
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 06:29:12 +0000 (06:29 +0000)]
Fix a comment in the Java TSerializer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665539
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 00:58:04 +0000 (00:58 +0000)]
Add Stop methods for C# servers.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665538
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Sun, 2 Mar 2008 00:25:58 +0000 (00:25 +0000)]
Adding a few integration points to the C++ TSocketPool.
- 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
David Reiss [Sun, 2 Mar 2008 00:20:47 +0000 (00:20 +0000)]
Fix potential out of bounds read issue with getTypeIDForTypeName().
Make sure type name is at least 2 characters long.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665536
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Fri, 29 Feb 2008 07:33:47 +0000 (07:33 +0000)]
Bug fix for C++ TSocketPool
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
David Reiss [Thu, 28 Feb 2008 21:20:12 +0000 (21:20 +0000)]
Fail and retry logic for TSocketPool
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
David Reiss [Thu, 28 Feb 2008 21:11:39 +0000 (21:11 +0000)]
Fix for JSON Protocol string-reading methods.
Clear return-by-reference strings before appending to them
in the JSON Protocol reading methods.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665533
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Thu, 28 Feb 2008 21:11:34 +0000 (21:11 +0000)]
Fix for Base64 decoding.
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
eletuchy [Wed, 27 Feb 2008 23:50:21 +0000 (23:50 +0000)]
[thrift] erlang: fixing error logger for devious "not-quite-right" lists
Summary: ... a la dictionary
Reviewed By: cpiro
Test Plan: bin_trim of a dict with a stored integer value
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665531
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 22:28:12 +0000 (22:28 +0000)]
Fix a subtle bug in cpp_use_include_path.
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
eletuchy [Wed, 27 Feb 2008 19:56:52 +0000 (19:56 +0000)]
[thrift] erlang: dialyzer bug: binary protocol double type ...
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
eletuchy [Wed, 27 Feb 2008 19:55:15 +0000 (19:55 +0000)]
[thrift] erlang: dialyzer bug: bad usage of ++ operator on a non-list
Reviewed By: cpiro
Test Plan: make dialyzer -j
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665528
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 19:38:51 +0000 (19:38 +0000)]
Add an operator< for Thrift structs (in C++).
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
eletuchy [Wed, 27 Feb 2008 19:27:41 +0000 (19:27 +0000)]
[thrift] erlang: dialyzer bug: tSocket reading of send_timeout preference
Reviewed By: cpiro
Test Plan: make dialyzer
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665526
13f79535-47bb-0310-9956-
ffa450edef68
eletuchy [Wed, 27 Feb 2008 18:38:42 +0000 (18:38 +0000)]
[thrift] erlang dialyzer error
Summary: impossible pattern matches are never good
Reviewed By: cpiro
Test Plan: make dialyzer
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665525
13f79535-47bb-0310-9956-
ffa450edef68
eletuchy [Wed, 27 Feb 2008 17:43:40 +0000 (17:43 +0000)]
[thrift] make erlang error logger more efficient
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
eletuchy [Wed, 27 Feb 2008 17:41:05 +0000 (17:41 +0000)]
[thrift] adding dialyzer to erlang library Makefile
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
eletuchy [Wed, 27 Feb 2008 16:31:01 +0000 (16:31 +0000)]
[thrift] making erlang thrift error logger slightly nicer for printing binaries
Reviewed By: cpiro
Test Plan: ran some services ... verified that they worked
Revert Plan: sure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665522
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 07:45:10 +0000 (07:45 +0000)]
Fix a warning message.
Forgot to update this when copy-pasting.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665521
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 07:45:05 +0000 (07:45 +0000)]
Make limited reflection optional (off by default).
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
David Reiss [Wed, 27 Feb 2008 07:45:00 +0000 (07:45 +0000)]
Update test/Makefile.am to use the new compiler command-line format.
Tested by running make check.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665519
13f79535-47bb-0310-9956-
ffa450edef68
Mark Slee [Wed, 27 Feb 2008 04:29:34 +0000 (04:29 +0000)]
Make compiler work on cpp_includes with < in them
Reviewed By: spiantino
Test Plan: build multifeed aggregator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665518
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 02:39:25 +0000 (02:39 +0000)]
Allow the Thrift compiler to be built without the Java generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-java
- Update the compiler Makefile.am to exclude the generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665517
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:33 +0000 (01:55 +0000)]
Allow the Thrift compiler to be built without the C++ generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-cpp
- Update the compiler Makefile.am to exclude the generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665516
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:30 +0000 (01:55 +0000)]
Infrastructure for excluding code generators from the Thrift compiler.
Add a new autoconf macro (a thin wrapper around AC_ARG_ENABLE) that
makes it pretty easy to include or exclude specific code genreators.
This will be tested along with future changes that use it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665515
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:25 +0000 (01:55 +0000)]
Make the Java generator use non-hardcoded namespaces.
- Make the Java generator use program->get_namespace("java")
instead of program->get_java_namespace()
- Eliminate the explicit "java_namespace" in t_program.
- Deprecate the java_namespace token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665514
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:17 +0000 (01:55 +0000)]
Make the C++ generator use non-hardcoded namespaces.
- Make the C++ generator use program->get_namespace("cpp")
instead of program->get_cpp_namespace()
- Eliminate the explicit "cpp_namespace" in t_program.
- Deprecate the cpp_namespace token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665513
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:13 +0000 (01:55 +0000)]
Infrastructure for a language-neutral namespace declaration.
Altered the once-deprecated "namespace" directive in .thrift files
to take two identifiers: the language and the namespace.
They are stored in a map inside of the program object.
Future changes will convert specific generators to use this map
and deprecate the old language-specific tokens.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665512
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:09 +0000 (01:55 +0000)]
Remove t_java_generator.h.
t_java_generator.h is no longer included anywhere, because
the Java generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
Also cleaned up its includes a little bit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665511
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:55:05 +0000 (01:55 +0000)]
Make the Java generator dynamic.
- Modify the Java generator constructor to fit the new generic interface.
- Register the Java genrator with the central registry.
- Deprecate the old way of invoking the Java generator.
- main.cc no longer includes t_java_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665510
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:54:59 +0000 (01:54 +0000)]
Remove t_cpp_generator.h.
t_cpp_generator.h is no longer included anywhere, because
the C++ generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
Also cleaned up its includes a little bit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665509
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:54:55 +0000 (01:54 +0000)]
Make the C++ generator dynamic.
- Modify the C++ generator constructor to fit the new generic interface.
- Register the C++ genrator with the central registry.
- Deprecate the old way of invoking the C++ generator.
- main.cc no longer includes t_cpp_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665508
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:54:51 +0000 (01:54 +0000)]
Infrastructure for loading code generators a bit more dynamically.
Add a generic and easy-to-use mechanism for Thrift code generators to
register themselves centrally. The central registry is used to
obtain documentation for the options accepted by individual generators
and get instances of individual generators. It also does a little bit of
option parsing that will be useful for all generators.
Obviously, this change cannot be tested on its own. I can only say
that Thrift still builds and runs correctly. Subsequent changes
will apply this infrastructure to specific code generators.
Steve Grimm has assured me that this is standard Git practice.
In fact, I ran this test after converting the C++ and Java generators:
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ mkdir old new
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ cd old
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ ../../compiler/cpp/thrift -cpp -dense -java -javabean ../DebugProtoTest.thrift
[WARNING::1] -cpp is deprecated. Use --gen cpp
[WARNING::1] -java is deprecated. Use --gen java
[WARNING::1] -javabean is deprecated. Use --gen java:beans
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ cd ../new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ ../../compiler/cpp/thrift --gen cpp:dense --gen java --gen java:beans ../DebugProtoTest.thrift
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ cd ..
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ diff -ur old/ new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test$
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665507
13f79535-47bb-0310-9956-
ffa450edef68
David Reiss [Wed, 27 Feb 2008 01:54:47 +0000 (01:54 +0000)]
Make warnings from the Thrift compiler a little clearer.
Reviewed by: mcslee
Warning and error messages from the Thrift compiler include
the file currently being parsed and the line number.
This change sets those to dummy values for stages that
have nothing to do with parsing.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665506
13f79535-47bb-0310-9956-
ffa450edef68
eletuchy [Tue, 26 Feb 2008 12:11:29 +0000 (12:11 +0000)]
[thrift] don't do a reverse DNS lookup for every erlang thrift request
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