[jira] [Updated] (THRIFT-2023) gettimeofday implementation on Windows errors when no time zone is passed in.

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2023:
--

Issue Type: Bug  (was: Improvement)

 gettimeofday implementation on Windows errors when no time zone is passed in.
 -

 Key: THRIFT-2023
 URL: https://issues.apache.org/jira/browse/THRIFT-2023
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: win_gettimeofday.patch


 Some of the Thrift tests use gettimeofday passing NULL as the second 
 argument.  In those situations, the Windows implmentation returns -1, and 
 causes the tests to freak out.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2022) CoB and dense code generation still uses TR1 bind, even though that doesn't work with clang

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2022:
--

Issue Type: Bug  (was: Improvement)

 CoB and dense code generation still uses TR1 bind, even though that doesn't 
 work with clang
 ---

 Key: THRIFT-2022
 URL: https://issues.apache.org/jira/browse/THRIFT-2022
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Compiler
Affects Versions: 0.9
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: tr1_purge.patch


 Until recently, lots of Thrift stuff used std::tr1::function and 
 std::tr1::bind.  Most stuff got retrofit to use apache::thrift::stdcxx 
 versions, but cob and dense code generation got missed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2025) Fix TSSLServerSocket 64-bit builds

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2025:
-

 Summary: Fix TSSLServerSocket 64-bit builds
 Key: THRIFT-2025
 URL: https://issues.apache.org/jira/browse/THRIFT-2025
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Mac 64, Linux 64, Win 64
Reporter: Ben Craig
 Fix For: 1.0


Assorted size_t - int conversions.
One long - int truncation.
Squelching one warning that should be safe dealing with Win64 and SOCKET - int 
conversions.
No longer using namespace boost, as that can cause ambiguities between global 
uint8_t and boost::uint8_t.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2025) Fix TSSLServerSocket 64-bit builds

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2025:
--

Attachment: ssl_port.patch

 Fix TSSLServerSocket 64-bit builds
 --

 Key: THRIFT-2025
 URL: https://issues.apache.org/jira/browse/THRIFT-2025
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Mac 64, Linux 64, Win 64
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: ssl_port.patch


 Assorted size_t - int conversions.
 One long - int truncation.
 Squelching one warning that should be safe dealing with Win64 and SOCKET - 
 int conversions.
 No longer using namespace boost, as that can cause ambiguities between 
 global uint8_t and boost::uint8_t.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2024) TServer.cpp warns on 64-bit platforms about truncating an rlim_t into an int

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2024:
-

 Summary: TServer.cpp warns on 64-bit platforms about truncating an 
rlim_t into an int
 Key: THRIFT-2024
 URL: https://issues.apache.org/jira/browse/THRIFT-2024
 Project: Thrift
  Issue Type: Improvement
Affects Versions: 0.9
 Environment: Linux 64, Mac 64
Reporter: Ben Craig
 Fix For: 1.0
 Attachments: TServer_rlim.patch

Thrift recently changed increase_max_fds to return an int instead of an 
rlim_t.  Now TServer.cpp warns when it converts the internal rlim_t to the 
external int.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2026) Fix TCompactProtocol 64 bit builds

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2026:
--

Attachment: compact_int_stuff.patch

 Fix TCompactProtocol 64 bit builds
 --

 Key: THRIFT-2026
 URL: https://issues.apache.org/jira/browse/THRIFT-2026
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Mac 64, Win 64, Linux 64
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compact_int_stuff.patch


 TCompactProtocol has several places where it truncates a size_t to a 32-bit 
 value.
 TCompactProtocol also does bitwise operations on signed values, which has 
 undefined behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2026) Fix TCompactProtocol 64 bit builds

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2026:
-

 Summary: Fix TCompactProtocol 64 bit builds
 Key: THRIFT-2026
 URL: https://issues.apache.org/jira/browse/THRIFT-2026
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Mac 64, Win 64, Linux 64
Reporter: Ben Craig
 Fix For: 1.0
 Attachments: compact_int_stuff.patch

TCompactProtocol has several places where it truncates a size_t to a 32-bit 
value.

TCompactProtocol also does bitwise operations on signed values, which has 
undefined behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2027) Minor 64-bit and NOMINMAX issues in C++ library

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2027:
-

 Summary: Minor 64-bit and NOMINMAX issues in C++ library
 Key: THRIFT-2027
 URL: https://issues.apache.org/jira/browse/THRIFT-2027
 Project: Thrift
  Issue Type: Bug
Affects Versions: 0.9
 Environment: 64-bit.  Windows without NOMINMAX set.
Reporter: Ben Craig
Priority: Minor
 Fix For: 1.0


TNonblockingServer and THttpServer have size_t - uint32_t truncations.

TZlibTransport calls std::min without enclosing it in parens.  This is a really 
minor issue, since we technically build with NOMINMAX in the environment (which 
fixes the problem), but I have a strange personal goal of being able to build 
without setting NOMINMAX.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2027) Minor 64-bit and NOMINMAX issues in C++ library

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2027:
--

Attachment: misc_minor.patch

 Minor 64-bit and NOMINMAX issues in C++ library
 ---

 Key: THRIFT-2027
 URL: https://issues.apache.org/jira/browse/THRIFT-2027
 Project: Thrift
  Issue Type: Bug
Affects Versions: 0.9
 Environment: 64-bit.  Windows without NOMINMAX set.
Reporter: Ben Craig
Priority: Minor
 Fix For: 1.0

 Attachments: misc_minor.patch


 TNonblockingServer and THttpServer have size_t - uint32_t truncations.
 TZlibTransport calls std::min without enclosing it in parens.  This is a 
 really minor issue, since we technically build with NOMINMAX in the 
 environment (which fixes the problem), but I have a strange personal goal of 
 being able to build without setting NOMINMAX.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2028) Cleanup threading headers / libraries

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2028:
-

 Summary: Cleanup threading headers / libraries
 Key: THRIFT-2028
 URL: https://issues.apache.org/jira/browse/THRIFT-2028
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
Reporter: Ben Craig
 Fix For: 1.0
 Attachments: thread_cleanup.patch

The current threading implementations have some minor annoyances:
All do some amount of internal state tracking with an enum that ends up being 
overkill.
All use weak_ptrs to help manage lifetimes, instead of the 
enable_shared_from_this base class that was designed for exactly this purpose.
All of the specific thread factories implement detached methods, but the base 
thread factory doesn't have virtual methods exposing the detached methods.
The thread manager has an unused local.
Adding a UniqueGuard class to Mutex.h, to give more flexible RAII management 
to locks.  Currently no clients of this, but I have some patches that will 
eventually use this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2028) Cleanup threading headers / libraries

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2028:
--

Attachment: thread_cleanup.patch

 Cleanup threading headers / libraries
 -

 Key: THRIFT-2028
 URL: https://issues.apache.org/jira/browse/THRIFT-2028
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: thread_cleanup.patch


 The current threading implementations have some minor annoyances:
 All do some amount of internal state tracking with an enum that ends up being 
 overkill.
 All use weak_ptrs to help manage lifetimes, instead of the 
 enable_shared_from_this base class that was designed for exactly this purpose.
 All of the specific thread factories implement detached methods, but the 
 base thread factory doesn't have virtual methods exposing the detached 
 methods.
 The thread manager has an unused local.
 Adding a UniqueGuard class to Mutex.h, to give more flexible RAII 
 management to locks.  Currently no clients of this, but I have some patches 
 that will eventually use this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-2029) Port C++ tests to Windows

2013-06-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-2029:
--

Attachment: porting_tests.patch

 Port C++ tests to Windows
 -

 Key: THRIFT-2029
 URL: https://issues.apache.org/jira/browse/THRIFT-2029
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: porting_tests.patch


 The attached patch makes the Thrift tests buildable with Visual Studio 2008 
 (msvc9) + Boost 1.50, and Visual Studio 2012 Update 1 (msvc11) + Boost 1.50.  
 It will likely build with other versions of msvc and older boosts.  I don't 
 have usable project files, but the code changes that are attached should go a 
 long way to making the project files easier for someone else.
 Tests addressed:
 * stress test
 * nonblocking stress test
 * fd transport test
 * piped transport test
 * debug proto test
 * json proto test
 * optional required test
 * specialization test
 * all protocol test
 * transport test (mostly)
 * zlib test
 * unit test
 * thread test
 * TestClient + TestServer over binary, json, buffered, framed, simple, 
 thread-pool, threaded, and nonblocking+binary+framed.
 Tests not addressed:
 * Other variants of TestClient + TestServer, notably http.  There are 
 also some variations that the existing test.sh doesn't try, and I haven't 
 tested those variations either.
 * TFileTransportTest.  File transport isn't quite working on Windows right 
 now, and I haven't the time to try and fix it.
 * processor_test and concurrency_test.  Makefile.am says these tests are too 
 strong, so I haven't attempted to port them yet.
 * FileTransport and FDTransport parts of the transport test.  These aren't 
 really working on Windows right now, so I left them mostly broken.
 General changes:
 * Lots of migration from snprintf to THRIFT_SNPRINTF.
 * Lots of min / max parenthisizing to be able to build without NOMINMAX.
 * #define of _USE_MATH_DEFINES to get access to _M_PI
 * assorted size_t issues.
 * No longer using getopt in the transport test or zlib test.  The scripts 
 didn't use the getopt functionality.  The main loss is that you will no 
 longer be able to manually set a seed.
 * Rewrote transport test's trigger / alarm facility to use threads instead of 
 sigalarm.
 * tr1 - thrift::stdcxx changes
 * lots of apache::thrift::transport::TWinsockSingleton::create();
 * Fixed a race in stress test where the client could try to connect before 
 the server had started to listen.
 * removed lots of using namespace boost to address uint8_t ambiguities.
 * Shortened simulated work sleeps significantly to make TestClient + 
 TestServer test iterations go lots faster.
 * Making it so that TestServer can be shut down in a way other than with 
 kill or task manager.  Now, hitting enter on the keyboard will stop the 
 server.  This shouldn't break existing scripts, but it makes it possible for 
 new scripts to gracefully tear down a server and check the exit status.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-2029) Port C++ tests to Windows

2013-06-13 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-2029:
-

 Summary: Port C++ tests to Windows
 Key: THRIFT-2029
 URL: https://issues.apache.org/jira/browse/THRIFT-2029
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows
Reporter: Ben Craig
 Fix For: 1.0
 Attachments: porting_tests.patch

The attached patch makes the Thrift tests buildable with Visual Studio 2008 
(msvc9) + Boost 1.50, and Visual Studio 2012 Update 1 (msvc11) + Boost 1.50.  
It will likely build with other versions of msvc and older boosts.  I don't 
have usable project files, but the code changes that are attached should go a 
long way to making the project files easier for someone else.

Tests addressed:
* stress test
* nonblocking stress test
* fd transport test
* piped transport test
* debug proto test
* json proto test
* optional required test
* specialization test
* all protocol test
* transport test (mostly)
* zlib test
* unit test
* thread test
* TestClient + TestServer over binary, json, buffered, framed, simple, 
thread-pool, threaded, and nonblocking+binary+framed.

Tests not addressed:
* Other variants of TestClient + TestServer, notably http.  There are 
also some variations that the existing test.sh doesn't try, and I haven't 
tested those variations either.
* TFileTransportTest.  File transport isn't quite working on Windows right now, 
and I haven't the time to try and fix it.
* processor_test and concurrency_test.  Makefile.am says these tests are too 
strong, so I haven't attempted to port them yet.
* FileTransport and FDTransport parts of the transport test.  These aren't 
really working on Windows right now, so I left them mostly broken.

General changes:
* Lots of migration from snprintf to THRIFT_SNPRINTF.
* Lots of min / max parenthisizing to be able to build without NOMINMAX.
* #define of _USE_MATH_DEFINES to get access to _M_PI
* assorted size_t issues.
* No longer using getopt in the transport test or zlib test.  The scripts 
didn't use the getopt functionality.  The main loss is that you will no longer 
be able to manually set a seed.
* Rewrote transport test's trigger / alarm facility to use threads instead of 
sigalarm.
* tr1 - thrift::stdcxx changes
* lots of apache::thrift::transport::TWinsockSingleton::create();
* Fixed a race in stress test where the client could try to connect before the 
server had started to listen.
* removed lots of using namespace boost to address uint8_t ambiguities.
* Shortened simulated work sleeps significantly to make TestClient + 
TestServer test iterations go lots faster.
* Making it so that TestServer can be shut down in a way other than with 
kill or task manager.  Now, hitting enter on the keyboard will stop the 
server.  This shouldn't break existing scripts, but it makes it possible for 
new scripts to gracefully tear down a server and check the exit status.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-2014) Change C++ lib includes to use namespace/ style throughout

2013-06-10 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13679490#comment-13679490
 ] 

Ben Craig commented on THRIFT-2014:
---

I would love for thrift/config.h to be the proper way to include the config 
headers.  I've thought of doing that myself, but my automake / configure skills 
aren't all that great.

 Change C++ lib includes to use namespace/ style throughout
 

 Key: THRIFT-2014
 URL: https://issues.apache.org/jira/browse/THRIFT-2014
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 1.0
 Environment: All
Reporter: Randy Abernethy
Assignee: Randy Abernethy
Priority: Minor
 Fix For: 1.0

 Attachments: 0004-Changed-C-lib-includes-to-use-namespace-form.patch


 Use #includethrift/... style include statements throughout C++ library (see 
 Exception below)
 Rational: Improve consistency and predictability in C++ library and user 
 builds. Because Apache Thrift is a library, system style includes () may be 
 a better fit than local style includes (“”). System style includes are 
 presently used predominantly (4:1) but not exclusively and the choice between 
 the two often appears to have no pattern. Making the library’s approach 
 thrift/ consistent will improve build predictability (e.g local copies of 
 include files will not be picked up). Using explicit thrift relative paths 
 (i.e. namespaces like thrift/transport) also adds clarity and specificity 
 (e.g. two files with the same name can exist in separate directories and can 
 be included with obvious and predictable results, avoiding most path order 
 dependencies). The “” include is commonly designated as a user include (e.g. 
 gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#Include-Syntax), the search 
 pattern for “” tends to vary from compiler to compiler a bit also.
 bg:  POSIX compliant compilers (and many others) search only –I directories 
 and then standard directories for system #include dependencies (good for 
 libraries). A local #include “” causes local directories (typically the 
 location of the including file) to be searched, then the –I, then built-in 
 paths. The POSIX spec is not adhered to by all platforms/compilers and more 
 complex behavior is common, making  tricky on occasion.
 Current situation:
 447 instances of thrift/...  e.g.:
 lib/cpp/src/thrift/transport/TFileTransport.h:#include 
 thrift/transport/TTransport.h
 lib/cpp/src/thrift/transport/TTransportUtils.h:#include 
 thrift/transport/TTransport.h
 116 instances of “file.h”  e.g.:
 lib/cpp/src/thrift/transport/TSocket.h:#include TTransport.h   
//Same header with “” and  styles in different files 
 lib/cpp/src/thrift/transport/TFileTransport.cpp:#include TTransportUtils.h
//Single file including thrift headers in different ways (“” and )
 Exceptions: A header presented with local style (“”) delimiters is a hint 
 indicating that the header is designed to be locally defined or potentially 
 overloaded. The config.h header (associated with HAVE_CONFIG_H) may have this 
 “locally defined” semantic. The config.h is also included with  and “” in 
 different locations. Assuming we want people to be able to locally override 
 config.h, #include “config.h” is the right answer. That said config.h is a 
 pretty generic name to be including with config.h safely. If only the 
 config.h in the thrift root should be allowed then thrift/config.h may be 
 the right answer. Thoughts?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2013-06-08 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13678766#comment-13678766
 ] 

Ben Craig commented on THRIFT-1753:
---

Short answer: I don't think the boost header dependency for the core thrift 
libraries is going away anytime soon.

Longer answer:
Thrift has several dependencies, and the dependencies vary a bit depending on 
your compiler, and whether you want to build the tests.
Thrift compiler has a dependency on Flex and Bison
Core thrift has a dependency on boost headers, and for non-posix, non-C++11 
compilers, a dependency on boost libraries.
Zlib transport obviously has a dependency on zlib.
Nonblocking server has a dependency on libevent.
SSL stuff has a dependency on openssl.
Thrift tests depend on boost libraries.

On Windows, getting all these dependencies in place takes a fair amount of 
effort.  Of all those dependencies though, boost headers is probably the least 
painful.

So that sort of addresses the benefit side of the cost/benefit.  On the cost 
side...

It wouldn't be too hard to add a build time flag, and make all the core code do 
something like thrift::shared_ptr, with thrift::shared_ptr being an alias for 
either boost or std.  The problem is that client code would either need to use 
thrift::shared_ptr everywhere, or they would need to make their code 
non-portable with respect to other thrift variants.  At my company, I have code 
that uses Thrift that needs to be built on both C++11 and non-C++11 compilers, 
so I would feel that portability cost.

Eventually, the boost - std shared_ptr bridge will have to be crossed, but I'm 
actually hoping that it will be crossed on the boost side, by making boost 
automatically alias to std::shared_ptr (or at least providing a conversion 
operator, somehow).

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 0.9.1

 Attachments: cleaner_port3.patch, cleaner_port4.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 

[jira] [Commented] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2013-06-07 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13678059#comment-13678059
 ] 

Ben Craig commented on THRIFT-1753:
---

Should be able to close out THRIFT-990 as well now, as this patch fixed that 
issue as well.

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port3.patch, cleaner_port4.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1948) Add a stream type

2013-05-03 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13648694#comment-13648694
 ] 

Ben Craig commented on THRIFT-1948:
---

What would the generated interfaces look like for a stream?  For example:
service QueryProvider {
  streamResult run_query()
}

Would that turn into run_query(std::vectorResult retval_) in C++?  Instead 
of a vector / list, would it be a new container class that would have streaming 
methods on it?  If it is a new container class, that does bring up the topic of 
Thrift re-entrance.

My gut reaction is that this kind of feature is useful, but that it doesn't 
belong in Thrift.  There are other protocols that model communication as a 
queue on the client, a queue on the server, and everything is basically a 
one-way communication, stuffing items into those queues.  Those protocols 
naturally lend themselves to streams.  Thrift is mostly about sending a 
message, and waiting for a response to that message.  One-way communication is 
the exception, rather than the rule.

 Add a stream type
 -

 Key: THRIFT-1948
 URL: https://issues.apache.org/jira/browse/THRIFT-1948
 Project: Thrift
  Issue Type: New Feature
  Components: AS3 - Compiler, AS3 - Library, C glib - Compiler, C glib 
 - Library, C# - Compiler, C# - Library, C++ - Compiler, C++ - Library, Cocoa 
 - Compiler, Cocoa - Library, Compiler (General), D - Compiler, D - Library, 
 Delphi - Compiler, Delphi - Library, Erlang - Compiler, Erlang - Library, Go 
 - Compiler, Go - Library, Haskell - Compiler, Haskell - Library, Java - 
 Compiler, Java - Library, JavaME - Compiler, JavaME - Library, JavaScript - 
 Compiler, JavaScript - Library, Node.js - Compiler, Node.js - Library, OCaml 
 - Compiler, OCaml - Library, Perl - Compiler, Perl - Library, PHP - Compiler, 
 PHP - Library, Python - Compiler, Python - Library, Ruby - Compiler, Ruby - 
 Library, Smalltalk - Compiler, Smalltalk - Library
Reporter: Carl Yeksigian
Assignee: Carl Yeksigian

 This is a proposal for an addition to the Thrift IDL, which allows for 
 sending chunks of data between the server and the client without having the 
 whole message in memory at the start of the communication.
 Here are two use cases where I have been thinking about the possibility of 
 using streams.
 LockServer.thrift:
 {code}
 struct Update {
   1: required string lock_handle,
   2: required i64 owner
 }
 service LockService {
   streamUpdate updates_for(1: string prefix)
 }
 {code}
 This would allow the LockServer to push out updates that happen based on the 
 prefix the client has specified, rather than the constant polling that would 
 currently be required to imitate this interface.
 ManyResults.thrift:
 {code}
 service QueryProvider {
   streamResult run_query()
 }
 {code}
 This allows the query provider to run the query and send back the results as 
 they come in, rather than having to bunch them up, or provide a way to page 
 through the results to the client.
 The new keyword, streamT, would indicate that there is a series of values 
 typed T which would be communicated between client and server. Stream would 
 have three primitives:
 {code}
 next(T)
 error(TException)
 end()
 {code}
 Protocols would be enhanced with the following methods:
 {code}
 writeStreamBegin(etype, streamid)
 writeStreamNext(streamid, streamMessageType)
 writeStreamNextEnd()
 writeStreamErrorEnd()
 etype, streamid = readStreamBegin()
 streamid, streamMessageType = readStreamNext()
 readStreamNextEnd()
 readStreamErrorEnd()
 {code}
 streamMessageType is one of the following:
 # next
   This means that the message will be of the element type.
 # error
   An exception was thrown during materialization of the stream.
   The stream is now closed.
 # end
   This means that the stream is finished.
   The stream is now closed.
 Once all streams are closed, readMessageEnd should be called. Before the 
 first writeStreamNext() could be called, the message should otherwise be 
 complete. Otherwise, an exception should be raised.
 It is possible that an exception will be thrown while the stream is being 
 materialized; however, this can only occur inside of a service. In this case, 
 error() will be called; the exception should be one of the exceptions that 
 the service call would have thrown. The values that were generated before the 
 exception will generally be valid, but may only have meaning if the stream is 
 ended. All streams which are currently open may get the same exception.
 If the following service was defined:
 {code}
 streami64 random_numbers(streami64 max)
 {code}
 A sample session from client to server would be:
 {code}
 writeMessageBegin()
 writeStreamBegin(I64, 0)
 writeStreamNext(0, next)
 writeI64(10)
 writeStreamNextEnd()
 writeStreamNext(0, end)
 

[jira] [Commented] (THRIFT-1948) Add a stream type

2013-05-03 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13648988#comment-13648988
 ] 

Ben Craig commented on THRIFT-1948:
---

If you can show sort of what the Java or C# code looks like, then I can make a 
recommendation on the C++ translation.

Regarding reentrancy...
Currently (at least with C++), when the server calls into the interface 
handler, the interface handler normally doesn't call back into the thrift 
server, protocol, processor, or transport.  If you pass in some iterable type 
that ends up calling into the protocol / processor / transport / thrift server, 
then that puts significant constraints on future implementations, especially if 
any implementations use any kind of interesting locking mechanisms.  I have 
such a server in my local copy of Thrift, and I just haven't had time to submit 
a patch for it.

If the feature fits without compromising future growth, or other data 
structures, then it could still make sense to add it to Thrift.  Getting it in 
will just be more of a challenge since streams don't seem to align completely 
with Thrift's current approach.

 Add a stream type
 -

 Key: THRIFT-1948
 URL: https://issues.apache.org/jira/browse/THRIFT-1948
 Project: Thrift
  Issue Type: New Feature
  Components: AS3 - Compiler, AS3 - Library, C glib - Compiler, C glib 
 - Library, C# - Compiler, C# - Library, C++ - Compiler, C++ - Library, Cocoa 
 - Compiler, Cocoa - Library, Compiler (General), D - Compiler, D - Library, 
 Delphi - Compiler, Delphi - Library, Erlang - Compiler, Erlang - Library, Go 
 - Compiler, Go - Library, Haskell - Compiler, Haskell - Library, Java - 
 Compiler, Java - Library, JavaME - Compiler, JavaME - Library, JavaScript - 
 Compiler, JavaScript - Library, Node.js - Compiler, Node.js - Library, OCaml 
 - Compiler, OCaml - Library, Perl - Compiler, Perl - Library, PHP - Compiler, 
 PHP - Library, Python - Compiler, Python - Library, Ruby - Compiler, Ruby - 
 Library, Smalltalk - Compiler, Smalltalk - Library
Reporter: Carl Yeksigian
Assignee: Carl Yeksigian

 This is a proposal for an addition to the Thrift IDL, which allows for 
 sending chunks of data between the server and the client without having the 
 whole message in memory at the start of the communication.
 Here are two use cases where I have been thinking about the possibility of 
 using streams.
 LockServer.thrift:
 {code}
 struct Update {
   1: required string lock_handle,
   2: required i64 owner
 }
 service LockService {
   streamUpdate updates_for(1: string prefix)
 }
 {code}
 This would allow the LockServer to push out updates that happen based on the 
 prefix the client has specified, rather than the constant polling that would 
 currently be required to imitate this interface.
 ManyResults.thrift:
 {code}
 service QueryProvider {
   streamResult run_query()
 }
 {code}
 This allows the query provider to run the query and send back the results as 
 they come in, rather than having to bunch them up, or provide a way to page 
 through the results to the client.
 The new keyword, streamT, would indicate that there is a series of values 
 typed T which would be communicated between client and server. Stream would 
 have three primitives:
 {code}
 next(T)
 error(TException)
 end()
 {code}
 Protocols would be enhanced with the following methods:
 {code}
 writeStreamBegin(etype, streamid)
 writeStreamNext(streamid, streamMessageType)
 writeStreamNextEnd()
 writeStreamErrorEnd()
 etype, streamid = readStreamBegin()
 streamid, streamMessageType = readStreamNext()
 readStreamNextEnd()
 readStreamErrorEnd()
 {code}
 streamMessageType is one of the following:
 # next
   This means that the message will be of the element type.
 # error
   An exception was thrown during materialization of the stream.
   The stream is now closed.
 # end
   This means that the stream is finished.
   The stream is now closed.
 Once all streams are closed, readMessageEnd should be called. Before the 
 first writeStreamNext() could be called, the message should otherwise be 
 complete. Otherwise, an exception should be raised.
 It is possible that an exception will be thrown while the stream is being 
 materialized; however, this can only occur inside of a service. In this case, 
 error() will be called; the exception should be one of the exceptions that 
 the service call would have thrown. The values that were generated before the 
 exception will generally be valid, but may only have meaning if the stream is 
 ended. All streams which are currently open may get the same exception.
 If the following service was defined:
 {code}
 streami64 random_numbers(streami64 max)
 {code}
 A sample session from client to server would be:
 {code}
 writeMessageBegin()
 writeStreamBegin(I64, 0)
 

[jira] [Commented] (THRIFT-1890) C++: Make named pipes server work asynchronously

2013-03-19 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13606371#comment-13606371
 ] 

Ben Craig commented on THRIFT-1890:
---

This made progress, but at least with the threaded server, I still get a hang.  
The issue with the latest patch is that you return one last client pipe before 
closing and throwing a transport exception.  This last client pipe that is 
created gets added to the threaded server's list of tasks, and then the 
threaded server waits for that task to finish.

I will attach the toy program I used to test this.  If you want to make it part 
of the overall thrift test suite, I'm fine with that, or you can use it as a 
throwaway.

Thanks for looking at this as much as you have.  I'm hoping this proves useful 
for the Delphi implementation as well.

 C++: Make named pipes server work asynchronously 
 -

 Key: THRIFT-1890
 URL: https://issues.apache.org/jira/browse/THRIFT-1890
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: 
 THRIFT-1890_Cpp_Make_named_pipes_server_work_asynchronously-v2.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1890) C++: Make named pipes server work asynchronously

2013-03-19 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1890:
--

Attachment: pipeStopTest.cpp
addNumbers.thrift

Toy test case programs for exercising pipe stopping.  Also includes a socket 
stop, just to demonstrate that the use case works elsewhere.

 C++: Make named pipes server work asynchronously 
 -

 Key: THRIFT-1890
 URL: https://issues.apache.org/jira/browse/THRIFT-1890
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: addNumbers.thrift, pipeStopTest.cpp, 
 THRIFT-1890_Cpp_Make_named_pipes_server_work_asynchronously-v2.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1890) C++: Make named pipes server work asynchronously

2013-03-19 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1890:
--

Attachment: TPipeServer.cpp

Changes that work for me.  This file is likely hilariously out of date of the 
main branch.  I'm hoping that Jens can turn this back into a patch.

 C++: Make named pipes server work asynchronously 
 -

 Key: THRIFT-1890
 URL: https://issues.apache.org/jira/browse/THRIFT-1890
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: addNumbers.thrift, pipeStopTest.cpp, 
 THRIFT-1890_Cpp_Make_named_pipes_server_work_asynchronously-v2.patch, 
 TPipeServer.cpp


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1891) Add Windows ALPC transport which is right counterpart of Unix domain sockets

2013-03-18 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13605116#comment-13605116
 ] 

Ben Craig commented on THRIFT-1891:
---

Note the first sentence in the Wikipedia document:
The Local Procedure Call (LPC, often also referred to as Lightweight Procedure 
Call or Local Inter-Process Communication) is an internal, undocumented 
inter-process communication facility provided by the Microsoft Windows NT 
kernel for lightweight IPC between processes on the same computer.

As it is internal, and undocumented, that makes it difficult for something like 
Thrift to use it in a well supported way.

I think the closest that could be done in a supported way is to have a Thrift 
transport over MS-RPC using the ncalrpc protocol.  This may be reasonable, 
but some rough benchmarks would be useful to see if this is actually faster.

 Add Windows ALPC transport which is right counterpart of Unix domain sockets
 

 Key: THRIFT-1891
 URL: https://issues.apache.org/jira/browse/THRIFT-1891
 Project: Thrift
  Issue Type: New Feature
  Components: C++ - Library
Reporter: Dzmitry.Lahoda
  Labels: performance, transport, windows
   Original Estimate: 192h
  Remaining Estimate: 192h

 Reading about local IPC on Windows leads me to idea that Named Pipes is not 
 the transport should be used where Unix Domain sockets are on Unix. Other, 
 most probably faster, should be.
 ALPC and Unix Domain sockets are similar:
 1. No networking
 2. Simple names (no specific prefix)
 3. Articles impress that Windows ALPC and Unix Domain Sockets use more OS 
 kernel then Windows Named Pipes.
 Unix Domain sockets and Windows Named Pipes:
 1. Named pipes are design for Windows Domain printer and file sharing, not 
 local IPC.
 2. means Named Pipes do some networking even if are local by security.
 True MS design:
 Local Out of process COM and MS-RPC uses ALPC for local inter process 
 communication everywhere in the OS components.
 Can find in many processes via Sysinternals Process Monitor, look for
 ALPC Port : \RPC Control\OLE[RANDOM_GUID].
 Value:
 I think would be faster with lower resource usage.
 Links:
 http://en.wikipedia.org/wiki/Local_Procedure_Call
 http://www.zezula.net/en/prog/lpc.html
 Search LRPC on 
 http://technet.microsoft.com/en-us/library/cc738291(v=ws.10).aspx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1890) C++: Make named pipes server work asynchronously

2013-03-18 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13605191#comment-13605191
 ] 

Ben Craig commented on THRIFT-1890:
---

Did some testing, and didn't have much luck.  I was using a ThreadedServer.  
acceptImpl was sitting on WaitForSingleObject, even though I had called stop 
(and therefore interrupt + CancelIo) on my main thread.

I looked at the documentation for CancelIo, and it claims that it will only 
cancel io on the current thread.  That suggests that the cleanup usage inside 
of acceptImpl is fine, but the usage inside of interrupt is not.  I can think 
of two alternatives off of the top of my head:
1. Use CancelIoEx.  That will require you to share an overlapped structure 
between acceptImpl and interrupt.  That might be tricky on the synchronization 
side.
2. Create an extra event for interruption, and use WaitForMultipleObjects 
inside of acceptImpl.  Interrupt can then signal your extra event to wake up 
WaitForMultipleObjects, and that will give you the opportunity to check the 
_stop flag, or do something else to let the server tear down.

 C++: Make named pipes server work asynchronously 
 -

 Key: THRIFT-1890
 URL: https://issues.apache.org/jira/browse/THRIFT-1890
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: 
 THRIFT-1890_Cpp_Make_named_pipes_server_work_asynchronously.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1892) Socket timeouts are declared in milli-seconds, but are actually set in micro-seconds

2013-03-18 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13605247#comment-13605247
 ] 

Ben Craig commented on THRIFT-1892:
---

I looked at the code, and timeouts are wrong for both connection timeouts 
(handled in config.h) and send / recv timeouts (handled in TSocket.cpp), but 
these two are wrong for different reasons, and it isn't as simple as 
milliseconds being treated as microseconds.

In config.h poll_win32 is turning a millisecond timeout int into a timeval 
structure, and doing so incorrectly.  It fills in the timeval via 
{timeout/1000, timeout*1000}, but should do something like {timeout/1000, 
(timeout%1000)*1000}.

For the send and recv timeouts, setsockopt is called with a timeval, but 
WinSock is expecting a DWORD of milliseconds.  I suspect it is using the 
seconds parameter of the structure instead, which would mean that the value is 
off by a factor of 1000, matching the behavior observed in the bug description.

 Socket timeouts are declared in milli-seconds, but are actually set in 
 micro-seconds
 

 Key: THRIFT-1892
 URL: https://issues.apache.org/jira/browse/THRIFT-1892
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows 8 x64
Reporter: Alexander
Priority: Minor
  Labels: cpp, socket, timeout

 Socket timeouts are declared in milliseconds in TSocket.h:
   /**
* Set the connect timeout
*/
   void setConnTimeout(int ms);
   /**
* Set the receive timeout
*/
   void setRecvTimeout(int ms);
   /**
* Set the send timeout
*/
   void setSendTimeout(int ms);
 But, when i set timeout which is supposed to be 5000 seconds, and make a call 
 to the service function that intentionally hangs, ETIMEDOUT exception occurs 
 precisely after 5 seconds.
   socket-setConnTimeout(5*1000*1000);
   socket-setRecvTimeout(5*1000*1000);
   socket-setSendTimeout(5*1000*1000);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1890) C++: Make named pipes server work asynchronously

2013-03-15 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13604120#comment-13604120
 ] 

Ben Craig commented on THRIFT-1890:
---

This will probably fix THRIFT-1777.
I hope to be able to test Jens's patch on Monday.

Main oddity I saw in my quick review of the code was the cleanup of the 
overlapped.hevent.  That would probably be handled better by having an object 
destructor clean it up at the end of acceptImpl.  overlapped.hevent and the 
cleanup object would both have a handle to the same event.

 C++: Make named pipes server work asynchronously 
 -

 Key: THRIFT-1890
 URL: https://issues.apache.org/jira/browse/THRIFT-1890
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: 
 THRIFT-1890_Cpp_Make_named_pipes_server_work_asynchronously.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1880) Make named pipes server work asynchronously (overlapped) to allow for clean server stops

2013-03-11 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13599476#comment-13599476
 ] 

Ben Craig commented on THRIFT-1880:
---

Aww, only Delphi.  I was getting excited that someone else fixed basically the 
same bugs ( THRIFT-1776 and THRIFT-1777 ) in C++

 Make named pipes server work asynchronously (overlapped) to allow for clean 
 server stops
 

 Key: THRIFT-1880
 URL: https://issues.apache.org/jira/browse/THRIFT-1880
 Project: Thrift
  Issue Type: Improvement
  Components: Delphi - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: 
 THRIFT-1880_Make_named_pipes_server_work_asynchronously.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1880) Make named pipes server work asynchronously (overlapped) to allow for clean server stops

2013-03-11 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13599612#comment-13599612
 ] 

Ben Craig commented on THRIFT-1880:
---

If you post a C++ patch, I will gladly review it.

 Make named pipes server work asynchronously (overlapped) to allow for clean 
 server stops
 

 Key: THRIFT-1880
 URL: https://issues.apache.org/jira/browse/THRIFT-1880
 Project: Thrift
  Issue Type: Improvement
  Components: Delphi - Library
 Environment: Windows
Reporter: Jens Geyer
Assignee: Jens Geyer
 Fix For: 1.0

 Attachments: 
 THRIFT-1880_Make_named_pipes_server_work_asynchronously.patch


 Currently the named pipe server cannot be stopped gracefully due to the way 
 ConnectNamedPipe() works for synchronous named pipes. The recommended 
 solution is to run the pipe in overlapped mode, allowing the transport to 
 be closed cleanly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1875) BoostThreadFactory not compiling

2013-03-06 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13594805#comment-13594805
 ] 

Ben Craig commented on THRIFT-1875:
---

My suspicion is that this is the wrong fix for the problem.  Thread.h has the 
following code:

#ifdef USE_BOOST_THREAD
  typedef boost::thread::id id_t;

  static inline bool is_current(id_t t) { return t == 
boost::this_thread::get_id(); }
  static inline id_t get_current() { return boost::this_thread::get_id(); }
#else
  typedef pthread_t id_t;
  static inline bool is_current(id_t t) { return pthread_equal(pthread_self(), 
t); }
  static inline id_t get_current() { return pthread_self(); }
#endif

If USE_BOOST_THREAD isn't defined, then you will try to convert a 
BoostThread::getId() will try to convert a boost::thread::id to a pthread_t.

Basically, you should try to fix the typedef, and not the getId() call.

 BoostThreadFactory not compiling
 

 Key: THRIFT-1875
 URL: https://issues.apache.org/jira/browse/THRIFT-1875
 Project: Thrift
  Issue Type: Bug
  Components: Build Process, C++ - Library
Affects Versions: 0.9
 Environment: boost 1.44
 gcc 4.7.2
Reporter: Konrad Grochowski
 Attachments: THRIFT-1875-lexical_cast_fix.patch


 lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp:102:66: error: cannot 
 convert ‘boost::thread::id’ to ‘apache::thrift::concurrency::Thread::id_t 
 {aka long unsigned int}’ in return
 boost::thread::id is a class, cannot be cast to thrift::...::Thread::id_t 
 (long)
 seems I'm not the only one with that problem:
 http://mail-archives.apache.org/mod_mbox/thrift-user/201209.mbox/%3c993d39bb-2292-4641-9403-e76c29bec...@manbert.com%3E

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1870) Enhance TPipe / TPipeServer transport to support both Windows 64-bit and cross-platform *NIX support

2013-03-02 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13591571#comment-13591571
 ] 

Ben Craig commented on THRIFT-1870:
---

I have been on a Windows development hiatus for the last few months, so my 
local host communication has been able to go directly to TSocket.  At the time 
I made this change, I was able to get some basic cross platform usage out of 
(named) TPipe and the associated typedef.  They weren't particularly rigorous 
tests though.  0.9 was the first release for TPipe, so I wasn't breaking any 
client code by changing stuff from the old approach to the new approach, though 
I may have made things more difficult until they got fixed.

I had a different set of issues with TPipe on every platform.

Windows: TPipeServer doesn't conform very well to the TServerTransport 
interface.  Interrupt doesn't work (THRIFT-1777), and preServe events don't 
work right (THRIFT-1776).
OSX: Just passing in a string like foo as a pipename works poorly, because 
the pipe file is put in the current working directory.  If you put in a full 
path, you don't have portable code.  In addition, nothing in Thrift cleans up 
the pipe file, and there isn't a 100% safe way to do it.  Ideally, the last 
process to close the handle would clean up the file, but that isn't the case.
Linux: The same problems that OSX have are there for Linux as well, but on 
Linux, we can use abstract named pipes... except they don't work in Thrift.  
There's a ~4 line fix that I have in my local copy of Thrift that I haven't had 
the time to upstream.  Still, that fix requires passing in a std::string with 
the first character set to NULL, which isn't portable.

I don't recall having any compile time issues, but I also wasn't calling many 
different methods on TPipe / TSocket.  If there are some methods on TPipe or 
TSocket that make sense on the other class, then that seems like a reasonable 
portability improving change.

I haven't had any use cases for anonymous pipes, whether they be posix pipe 
based or Windows pipe based.  Their typical use case is to communicate between 
a parent process and a child process, or possibly between two sibling 
processes, and the code at my company rarely spawns child processes.  I'm glad 
to review patches for anonymous pipes (as I've reviewed this patch), but I 
doubt there will be a business case for me to do it personally.


 Enhance TPipe / TPipeServer transport to support both Windows 64-bit and 
 cross-platform *NIX support
 

 Key: THRIFT-1870
 URL: https://issues.apache.org/jira/browse/THRIFT-1870
 Project: Thrift
  Issue Type: Improvement
Affects Versions: 0.9
 Environment: Windows, *NIX
Reporter: Peace C
 Fix For: 0.9

 Attachments: TPipe_64bit_xplatform.patch


 This patch adds support for Windows 64-bit builds by using std::ptrdiff_t to 
 represent Windows' pipe HANDLE. It also restores cross-platform *NIX support 
 that was broken in THRIFT-1690.
 See contrib/transport-sample for a working cross-platform example of how to 
 use TPipe[Server]. I tested all permutations of Win32/64-bit clients with 
 Win32/64-bit servers and they were happy. Also tested successfully on OSX.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1870) Enhance TPipe / TPipeServer transport to support both Windows 64-bit and cross-platform *NIX support

2013-03-01 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13591178#comment-13591178
 ] 

Ben Craig commented on THRIFT-1870:
---

So the main changes that I see that improve portability are the addition of the 
TSocket and TServerSocket members, and the #ifdefed functions that are using 
those members.  Maybe I'm overlooking something, but I don't see any place 
where the HANDLE / ptrdiff_t data types are interacting with the TSocket and 
TServerSocket members.

I think the changes related to the TSocket and TServerSocket members are great, 
but I'm not really sure what was accomplished with the HANDLE - ptrdiff_t 
translation.  The main benefit I'm seeing right now is it lets you compile 
and link against methods that aren't really implemented in a useful way on 
*NIX.  If you revert the ptrdiff_t changes, then you could pretty easily ifdef 
away everything that referred to HANDLES, and then clients would get build time 
errors instead of run-time errors.

 Enhance TPipe / TPipeServer transport to support both Windows 64-bit and 
 cross-platform *NIX support
 

 Key: THRIFT-1870
 URL: https://issues.apache.org/jira/browse/THRIFT-1870
 Project: Thrift
  Issue Type: Improvement
Affects Versions: 0.9
 Environment: Windows, *NIX
Reporter: Peace C
 Fix For: 0.9

 Attachments: TPipe_64bit_xplatform.patch


 This patch adds support for Windows 64-bit builds by using std::ptrdiff_t to 
 represent Windows' pipe HANDLE. It also restores cross-platform *NIX support 
 that was broken in THRIFT-1690.
 See contrib/transport-sample for a working cross-platform example of how to 
 use TPipe[Server].

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1870) Enhance TPipe / TPipeServer transport to support both Windows 64-bit and cross-platform *NIX support

2013-03-01 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13591298#comment-13591298
 ] 

Ben Craig commented on THRIFT-1870:
---

I understand that client code should have as few ifdefs as possible.  I'm not 
sure how this change improves the state of client code.

TPipe.h typedefed TPipe to TSocket on *nix systems, and TPipeServer.h typedefed 
TPipeServer to TServerSocket on *nix.  Those typedefs made it so that client 
code could use the string constructor of TPipe and get a reasonable, named 
localhost transport, without client typedefs.

What my changes in THRIFT-1690 broke was using *nix anonymous pipes through 
TPipe.  This change doesn't seem to address that.

I don't see how the ptrdiff_t changes improve calling code portability.  
Portable calling code won't be using the ptrdiff_t constructor, or the get / 
set pipe handle functions, as those currently only apply to Windows named 
pipes.  Constructing the HANDLE, or using the get / set pipe handle functions 
in a meaningful way requires clients to write platform specific code anyway.  
That constructor and those methods are there as an escape hatch to allow 
client code to access APIs that Thrift hasn't abstracted yet.

Is there a different part of the patch that deals with anonymous unix pipes 
that didn't make it here?  I could see how supporting anonymous pipes in the 
future would motivate the ptrdiff_t changes.  However, using ptrdiff_t will 
cause problems on 64-bit linux, as you will be truncating a 64-bit user value 
into a 32-bit file descriptor, and that will cause warnings without a bunch of 
casting.  If you want to make anonymous Unix pipes work through TPipe, then you 
need a typedef that is HANDLE on Windows, and int on *nix.

 Enhance TPipe / TPipeServer transport to support both Windows 64-bit and 
 cross-platform *NIX support
 

 Key: THRIFT-1870
 URL: https://issues.apache.org/jira/browse/THRIFT-1870
 Project: Thrift
  Issue Type: Improvement
Affects Versions: 0.9
 Environment: Windows, *NIX
Reporter: Peace C
 Fix For: 0.9

 Attachments: TPipe_64bit_xplatform.patch


 This patch adds support for Windows 64-bit builds by using std::ptrdiff_t to 
 represent Windows' pipe HANDLE. It also restores cross-platform *NIX support 
 that was broken in THRIFT-1690.
 See contrib/transport-sample for a working cross-platform example of how to 
 use TPipe[Server]. I tested all permutations of Win32/64-bit clients with 
 Win32/64-bit servers and they were happy. Also tested successfully on OSX.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1865) Thrift don't build on Android

2013-02-24 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13585518#comment-13585518
 ] 

Ben Craig commented on THRIFT-1865:
---

This is a duplicate of THRIFT-1846, and THRIFT-1846 already has a patch.

 Thrift don't build on Android
 -

 Key: THRIFT-1865
 URL: https://issues.apache.org/jira/browse/THRIFT-1865
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 1.0
 Environment: Debian Gnu/linux, using Android NDK r8d.
Reporter: David
Priority: Critical
  Labels: c++

 Cross-compiling Thrift development version to Android give me the following 
 error:
 In file included from 
 /android-ndk-r8d/platforms/android-9/arch-arm/usr/include/sys/un.h:31:0,
  from /thrift/lib/cpp/src/thrift/transport/TSocket.cpp:26:
 /android-ndk-r8d/platforms/android-9/arch-arm/usr/include/linux/un.h:18:2: 
 error: 'sa_family_t' does not name a type
 /thrift/lib/cpp/src/thrift/transport/TSocket.cpp: In member function 'void 
 apache::thrift::transport::TSocket::openConnection(addrinfo*)':
 /thrift/lib/cpp/src/thrift/transport/TSocket.cpp:250:13: error: 'struct 
 sockaddr_un' has no member named 'sun_family'
 make[1]: *** 
 [obj/local/armeabi/objs/thrift-static/src/thrift/transport/TSocket.o] Error 
 1
 Looking throught the git repository I found this commit: THRIFT-1740 Make 
 C++ library build on OS X and iOS.
 It removes the import 'sys/socket.h' from socket.ccp needed by the struct 
 'sockaddr_un'. The problems arises because on some kernels versions the 
 header 'linux/un.h' didn't include 'linux/socket.h' and didnt have 
 sa_family_t defined.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1846) Restore socket.h header to support builds with Android NDK

2013-02-11 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13576342#comment-13576342
 ] 

Ben Craig commented on THRIFT-1846:
---

Just make sure that sockaddr, sockaddr_in, sockaddr_in6, addrinfo, timespec, 
and timeval all have their appropriate headers included on all platforms.  You 
don't want to force other clients to include headers in a specific order.

 Restore socket.h header to support builds with Android NDK
 --

 Key: THRIFT-1846
 URL: https://issues.apache.org/jira/browse/THRIFT-1846
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Building with Android Linux NDK R8D (and, it looks like, 
 all previous NDKs)
Reporter: Nate Rosenblum
 Fix For: 0.9

 Attachments: 
 0001-Restore-socket.h-include-to-support-Android-builds.patch, 
 socket-include-moved-back-to-cpp.patch


 Unlike every other rational un.h that I've seen, the sys/un.h (actually 
 linux/un.h) distributed with the Android NDK doesn't define sa_family_t or 
 include another header that does. Removal of socket.h in THRIFT-1740 broke 
 the Android build.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1846) Restore socket.h header to support builds with Android NDK

2013-01-29 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13565504#comment-13565504
 ] 

Ben Craig commented on THRIFT-1846:
---

THRIFT-1740 moved the #include from the .cpp to the .h.  Why isn't TSocket.h's 
inclusion of sys/socket.h not working for you?

Also, sorry about my patch for THRIFT-1740 causing you so many problems.  Seems 
that no matter how many platforms I build for, some other OS does things in a 
different strange way.

 Restore socket.h header to support builds with Android NDK
 --

 Key: THRIFT-1846
 URL: https://issues.apache.org/jira/browse/THRIFT-1846
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Building with Android Linux NDK R8D (and, it looks like, 
 all previous NDKs)
Reporter: Nate Rosenblum
 Fix For: 0.9

 Attachments: 
 0001-Restore-socket.h-include-to-support-Android-builds.patch


 Unlike every other rational un.h that I've seen, the sys/un.h (actually 
 linux/un.h) distributed with the Android NDK doesn't define sa_family_t or 
 include another header that does. Removal of socket.h in THRIFT-1740 broke 
 the Android build.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1846) Restore socket.h header to support builds with Android NDK

2013-01-29 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13565529#comment-13565529
 ] 

Ben Craig commented on THRIFT-1846:
---

The original patch is fine.  I foolishly assumed that TSocket.cpp included 
TSocket.h very early in the file, as opposed to being one of the last #includes.

If you were going to try an alternative patch, I would try moving the #include 
TSocket.h so that it immediately follows the #include config.h

 Restore socket.h header to support builds with Android NDK
 --

 Key: THRIFT-1846
 URL: https://issues.apache.org/jira/browse/THRIFT-1846
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Building with Android Linux NDK R8D (and, it looks like, 
 all previous NDKs)
Reporter: Nate Rosenblum
 Fix For: 0.9

 Attachments: 
 0001-Restore-socket.h-include-to-support-Android-builds.patch


 Unlike every other rational un.h that I've seen, the sys/un.h (actually 
 linux/un.h) distributed with the Android NDK doesn't define sa_family_t or 
 include another header that does. Removal of socket.h in THRIFT-1740 broke 
 the Android build.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1740) Make C++ library build on OS X and iOS

2013-01-20 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13558497#comment-13558497
 ] 

Ben Craig commented on THRIFT-1740:
---

I wasn't doing testing with cob_style when I made this patch.  If it causes the 
generated code to pull in tr1/functional, then it would be reasonable to make 
that code pull in cxxfunctional.h instead.

 Make C++ library build on OS X and iOS
 --

 Key: THRIFT-1740
 URL: https://issues.apache.org/jira/browse/THRIFT-1740
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Patch fixes OS X xcode 3.2 with gcc 4.2 toolchain.  Also 
 fixes iOS xcode 4.4 with clang 4.0 toolchain.
Reporter: Ben Craig
Assignee: Ben Craig
  Labels: c++, ios, mac
 Fix For: 0.9, 1.0

 Attachments: mac_and_ios.patch


 Various small issues keep the existing Thrift c++ libraries from building on 
 OS X and iOS.  For example, in Clang, there is no tr1/functional, only a 
 regular functional.  Instead of adding a new configure token and a million 
 #ifdefs, the patch has added a wrapper header that throws the relevant 
 functional symbols into the apache::thrift:stdcxx namespace.
 There are also several fixes for unused variable warnings in release mode.  I 
 have added a helper macro to better document these cases (as opposed to just 
 adding the mysterious ret=ret; everywhere).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1834) Unable to build C++ Thrift dynamic library on Windows

2013-01-18 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13557513#comment-13557513
 ] 

Ben Craig commented on THRIFT-1834:
---

Currently, Thrift is designed to be packaged as a static library.  As a static 
library, the consuming program / dll will only pull in the object files that it 
needs, so the per-binary size increase should be pretty small.

Thrift isn't a very good candidate to become a dynamic library.  No attempts 
are made to preserve binary compatibility, or to provide a C / COM-like 
interface to make binary compatibility easy.  Thrift throws exceptions derived 
from std::exception, and throwing those across module boundaries often cause 
trouble, especially when the consuming binary is built with a different 
compiler, or even a different version of Visual Studio.  Thrift uses boost and 
STL types extensively, and those don't maintain binary compatibility either.

It is likely possible to add conditional macros that let most users continue to 
package Thrift as a static library, and enable you to build Thrift as a DLL.  I 
do feel that that is encouraging you to shoot off your own foot though.

 Unable to build C++ Thrift dynamic library on Windows
 -

 Key: THRIFT-1834
 URL: https://issues.apache.org/jira/browse/THRIFT-1834
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows x86_64 MSVC 2010
Reporter: Chris Stylianou
  Labels: dll, msvc, thrift, windows

 I am unable to build a valid .dll version of the Thrift C++ library using 
 MSVC2010 as nothing has been declared with 
 __declspec(dllexport)/__declspec(dllimport), meaning that MSVC2010 (and 
 presumably all other versions) are unable to generate the import .lib that 
 should accompany the .dll library.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1776) TPipeServer should implement listen, so that TServerEventHandler preServe will work right

2012-12-05 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1776:
-

 Summary: TPipeServer should implement listen, so that 
TServerEventHandler preServe will work right
 Key: THRIFT-1776
 URL: https://issues.apache.org/jira/browse/THRIFT-1776
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
 Environment: Windows
Reporter: Ben Craig
 Fix For: 1.0


Currently, TPipeServer's named pipe half listens and accepts in acceptImpl. 
 This means that TServerEventHandler's preServe() callback will be fired before 
TPipeServer is really listening.

It shouldn't be too hard to fix this for named pipes, as there is already a 
TCreateNamedPipe method.  If that gets called in listen, it will probably fix 
this issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1777) TPipeServer is UNSTOPPABLE

2012-12-05 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1777:
-

 Summary: TPipeServer is UNSTOPPABLE
 Key: THRIFT-1777
 URL: https://issues.apache.org/jira/browse/THRIFT-1777
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
 Environment: Windows
Reporter: Ben Craig
 Fix For: 1.0


Most TServer stop methods call interrupt on their underlying server transports. 
 TPipeServer::interrupt() doesn't cause acceptImpl to wake up if it is blocked 
on ConnectNamedPipe.  This means the stop method on TServer variants blocks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2012-12-04 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1753:
--

Attachment: cleaner_port4.patch

Same as last patch, but now starting the TFileTransport flush thread, instead 
of just creating it and letting it do nothing.

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port3.patch, cleaner_port4.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-12-04 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1750:
--

Attachment: (was: compiler_cleanup.patch)

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-12-04 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1750:
--

Attachment: compiler_cleanup.patch

Putting a newline at the end of platform.h that was accidentally omitted.

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1481) Unix domain sockets in C++ do not support the abstract namespace

2012-12-04 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13509818#comment-13509818
 ] 

Ben Craig commented on THRIFT-1481:
---

I should be able to provide a .patch for this once THRIFT-1753 is resolved.  I 
haven't quite figured out a good workflow for managing incremental patches, and 
with the impending switch to Git, I'm hesitant to figure out an SVN based 
approach now.

 Unix domain sockets in C++ do not support the abstract namespace 
 -

 Key: THRIFT-1481
 URL: https://issues.apache.org/jira/browse/THRIFT-1481
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.8
Reporter: Asad Saeed
Priority: Minor

 Linux provides the ability to create a Unix Domain socket in an abstract 
 namespace independent of the filesystem. A abstract namespace is specified by 
 having the sockaddr_un.sun_path start with a NULL character.
 TServerSocket and TSocket both utilize snprintf when writing to the 
 sockaddr_un structure, which stops at the first NULL character. Abstract 
 namespace support can be added by using memcopy instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1771) make check fails on x64 for libboost_unit_test_framework.a

2012-12-03 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13508845#comment-13508845
 ] 

Ben Craig commented on THRIFT-1771:
---

I don't know if it currently configurable in Thrift to change from static - 
dynamic, but please don't force dynamic dependencies.  I'm great with letting 
dynamic boost deps be an option, but I don't want to deal with the extra 
deployment complexity when shipping Thrift.

 make check fails on x64 for libboost_unit_test_framework.a
 

 Key: THRIFT-1771
 URL: https://issues.apache.org/jira/browse/THRIFT-1771
 Project: Thrift
  Issue Type: Bug
  Components: Test Suite
Affects Versions: 0.9
 Environment: Fedora 17 x86 with boost-devel and boost-static 
 installed via yum
Reporter: Chris Stylianou
Priority: Minor
  Labels: boost, test, thrift

 When trying to build thrift, running the make check testsuite fails due to 
 the make file generated by ./configure pointing to dependency 
 libboost_unit_test_framework.a at $(BOOST_ROOT_PATH)/lib/. However on an 
 x64 systems, this is actually located in $(BOOST_ROOT_PATH)/lib64/.
 Also, is it possible to use the dynamic libraries instead of static?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2012-11-27 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1753:
--

Attachment: cleaner_port3.patch

Addresses the same issues mentioned above, plus it fixes THRIFT-990 by making 
everything use gettimeofday.  In addition, very little code should be using 
timespecs now.  Code dealing directly with POSIX wait functions, and code that 
clients can use directly still use timespecs, but everything else uses timevals 
now.

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port2.patch, cleaner_port3.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-990) Sanify gettimeofday usage codebase-wide

2012-11-27 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13504885#comment-13504885
 ] 

Ben Craig commented on THRIFT-990:
--

Mega-fix posted on THRIFT-1753

 Sanify gettimeofday usage codebase-wide
 ---

 Key: THRIFT-990
 URL: https://issues.apache.org/jira/browse/THRIFT-990
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Compiler, C++ - Library, Compiler (General)
Reporter: Christian Lavoie
Assignee: Christian Lavoie
Priority: Minor
 Fix For: 1.0


 Some parts of the codebase use {{gettimeofday}}, some parts use 
 {{clock_gettime}} on platforms that have (and fallback on {{gettimeofday}} 
 otherwise). We should use just one way.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1740) Make C++ library build on OS X and iOS

2012-11-16 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13498824#comment-13498824
 ] 

Ben Craig commented on THRIFT-1740:
---

Thanks for getting this committed!

I will see about getting THRIFT-1753 updated (Multiple C++ Windows, OSX, and 
iOS portability issues), and possibly a fix for THRIFT-990 (Sanify gettimeofday 
usage codebase-wide).

I am wondering why the THRIFT_UNUSED_VARIABLE part was removed in this patch.  
I realize that Makefile.am sets -Wno-unused and -Wno-sign-compare, but I'm 
hoping to be able to get rid of those.  In my own, local builds, I build with 
those warnings enabled.

 Make C++ library build on OS X and iOS
 --

 Key: THRIFT-1740
 URL: https://issues.apache.org/jira/browse/THRIFT-1740
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Patch fixes OS X xcode 3.2 with gcc 4.2 toolchain.  Also 
 fixes iOS xcode 4.4 with clang 4.0 toolchain.
Reporter: Ben Craig
Assignee: Ben Craig
  Labels: c++, ios, mac
 Fix For: 0.9, 1.0

 Attachments: mac_and_ios.patch


 Various small issues keep the existing Thrift c++ libraries from building on 
 OS X and iOS.  For example, in Clang, there is no tr1/functional, only a 
 regular functional.  Instead of adding a new configure token and a million 
 #ifdefs, the patch has added a wrapper header that throws the relevant 
 functional symbols into the apache::thrift:stdcxx namespace.
 There are also several fixes for unused variable warnings in release mode.  I 
 have added a helper macro to better document these cases (as opposed to just 
 adding the mysterious ret=ret; everywhere).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2012-11-16 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1753:
--

Attachment: cleaner_port2.patch

Does not yet address THRIFT-990.  Still contains THRIFT_UNUSED_VARIABLE.

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port2.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2012-11-16 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1753:
--

Attachment: (was: cleaner_port.patch)

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port2.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-11-14 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13497222#comment-13497222
 ] 

Ben Craig commented on THRIFT-1690:
---

I think we are agreeing (at least on some parts).  I don't want client code to 
require #ifdefs.  I think we might be disagreeing (or at least not 
understanding each other) on how to go about that.

My proposal (that I don't have immediate plans on implementing) is to have a 
TAnonymousPipe / TAnonymousSocket transport.  I think that would provide the 
appropriate level of abstraction in client code.

I would like TPipe to be focused on named pipes / AF_UNIX sockets.

If you have a specific suggestion for a way to merge the two in a way that is 
not client hostile, I would be glad to review it.  I am open to being proven 
wrong.  Of course, in the end, I'm not the one you need to convince, as I'm not 
a maintainer :)

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: lib_socket_typedef.patch, libthrift_pipe_size.patch, 
 libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-11-14 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13497482#comment-13497482
 ] 

Ben Craig commented on THRIFT-1690:
---

So what is the expectation of source compatibility with Thrift?  If I change 
TSocket and TServerSocket to be TCP only, TPipe and TServerPipe to be localhost 
named transports, and create TAnonymousPipe classes, would the code breaks be 
met with insurmountable resistance?

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: lib_socket_typedef.patch, libthrift_pipe_size.patch, 
 libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

2012-11-13 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1753:
--

Attachment: cleaner_port.patch

 Multiple C++ Windows, OSX, and iOS portability issues
 -

 Key: THRIFT-1753
 URL: https://issues.apache.org/jira/browse/THRIFT-1753
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Windows MSVC10, MSVC11
 OSX GCC-4.2
 iOS Clang-4.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: cleaner_port.patch


 These are all in the C++ library.  Here is a summary of what I changed. 
 All of these fixes make a ~5000 line patch (though a lot of that is 
 deleted lines).
 *   General cleanup of the msvc project
 *   Using HAVE_CONFIG_H instead of force including files
 *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
 *   Significant rework of windows portability.  No longer using config.h 
 and force_inc.h to make Windows look like *nix.  Instead, making lots of 
 Thrift specific #defines that are vaguely *nixy, and having those forward 
 to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
 ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
 approach doesn't work when multiple libraries attempt the same trick.  For 
 example, if openssl #defined errno to ::WSAGetLastError() as well, then 
 that would cause problems.
 *   Adding preprocessor flag that can optionally squelch console output. 
 Default behavior is unchanged.  Console output is great for home deployed 
 server apps, but it looks unprofessional for consumer apps.
 *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
 warnings.
 *   Adding redirector header for functional and tr1/functional.  Since 
 namespaces aren't consistent (std vs std::tr1), I have added symbols to 
 the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
 support
 *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
 now correctly sleeps for seconds, and usleep attempts to sleep for 
 microseconds (after converting very coarsely to milliseconds).
 *   Adding support for using C++11 std::thread (and mutex, and monitor). 
 Thrift already supported boost::thread and posix threads.  Clients that 
 use std::thread no longer need built boost libraries.  The boost headers 
 are sufficient for them.  Switching from boost::thread to std::thread 
 resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
 and below will use boost::thread, msvc11 and up will use std::thread.
 *   Fixing more 64-bit socket truncation issues in non-blocking server and 
 ssl support.  openssl itself has socket truncation issues, so I could not 
 fix them all.
 *   Fixed THRIFT-1692 SO_REUSEADDR allows for socket hijacking on Windows 
 .  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
 *   Making TFileTransport use thrift style threads instead of redoing all 
 the pthread+boost stuff itself.
 *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
 and iOS)
 *   Moved several functions out of thrift/windows/config.h, and into other 
 thrift/windows headers.
 *   Using built-in stdint.h on Windows if available (by checking 
 HAVE_STDINT_H) and 
 using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-11-13 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13496527#comment-13496527
 ] 

Ben Craig commented on THRIFT-1690:
---

The old code was a bit of a portability mess.  The new code is a different 
portability mess.  The toy program that I've been using for my own testing has 
gotten away without needing to touch the raw HANDLE / file descriptor.  I would 
prefer to solve most use cases in that way, but still provide access to the 
underlying OS object when platform specific things are needed.  I think #ifdefs 
are inevitable there.  There is still significant room to improve though.  I 
don't think IntPtr is the answer though, as that is too large on 64-bit *nix 
platforms.

The projects I am working on care a lot about named pipes and named AF_UNIX 
sockets.  This is for Mac, Windows, and Linux, both 32 and 64-bit.  I am 
actively working on making it easy to use these in cross-platform code.  I hope 
to have patches for the following problems in the next month:
1. Portable naming.  I want to be able to construct my TTransport (or 
TServerTransport) without ifdefs.  That means that MyPipe needs to have the 
appropriate slashes added on Windows (already done).  It also means that 
MyPipe needs to either be put in a special folder on *nix, or needs to be an 
abstract socket.  Putting the socket file in the app's current working 
directory probably isn't desirable.
2. Better cleanup.  Stop doesn't currently work on TPipeServer.  Stopping 
AF_UNIX sockets doesn't clean up the file (and I'm not sure it can safely).  
Both of these cases are important to me, because my use cases aren't of the 
launch the app and let it run 2 years variety.  My clients and servers start 
and stop in interactive scenarios.

I don't have a personal need / interest in anonymous pipes.  I wasn't trying to 
break them, but I also didn't have tests for them.  I think the correct way to 
handle these is to have a new TServerTransport class specifically for anonymous 
pipes.  It may forward to TPipeServer and TServerSocket, but it can have the 
constructors that make sense for anonymous pipes, and not carry the baggage of 
named pipes.  

For the record, I'm not thrilled with the multi-purpose transports like 
TSocket, TPipe, and their server counterparts.  Porting single aspects of those 
classes is normally easy, but porting all of the aspects often doesn't work.  
My preferred approach would have involved TTCPSocket, TNamedSocket(?), 
TAnonymousSocket, and the like.  A lot of them would have similar 
implementations (possibly forwarding to helper classes), but it would make for 
more portable client code.

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: lib_socket_typedef.patch, libthrift_pipe_size.patch, 
 libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-12 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13495538#comment-13495538
 ] 

Ben Craig commented on THRIFT-1750:
---

MINGW still defines _WIN32, so that part seems to be fine.  My patch does have 
one MINGW issue though.  Windows uses MAX_PATH, while *nix usis PATH_MAX.  
MINGW takes the *nix approach.  I will post an updated patch to address this, 
after I get an in-house review.

My new patch will be tested against contrib/mingw-cross-compiler.sh before 
submission.

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-12 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1750:
--

Attachment: (was: compiler_cleanup.patch)

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-12 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1750:
--

Attachment: compiler_cleanup.patch

Updated to fix MINGW / MSVC PATH_MAX confusion.  Tested with mingw compile 
script.

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-09 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1750:
-

 Summary: Make compiler build cleanly under visual studio 10
 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0


Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-09 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1750:
--

Attachment: compiler_cleanup.patch

*   No more MINGW flags, now testing for built-in _WIN32 and _MSCVER flags
*   Now using a config.h (and associated HAVE_CONFIG_H) for the compiler
*   No longer using visual studio's force include feature
*   Tweaked VS project invocation of flex and bison so that it doesn't rely on 
process current working directory
*   Fixing various integer truncation warnings.  The scariest of these involves 
droppint field_ids from 64-bit to 32-bit.  They were already being truncated, 
now the struct is smaller as well.
*   Squelching assorted Visual Studio build warnings in the associated files, 
instead of globally


 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1751) definition of increase_max_fds doesn't compile when HAVE_SYS_RESOURCE_H is not defined

2012-11-09 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1751:
-

 Summary: definition of increase_max_fds doesn't compile when 
HAVE_SYS_RESOURCE_H is not defined
 Key: THRIFT-1751
 URL: https://issues.apache.org/jira/browse/THRIFT-1751
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
Reporter: Ben Craig
 Fix For: 1.0
 Attachments: TServer_guard.patch

The definition of increase_max_fds uses struct rlimit, which is defined in 
sys/resource.h.  If sys/resource.h doesn't get included, you get a compiler 
error.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1751) definition of increase_max_fds doesn't compile when HAVE_SYS_RESOURCE_H is not defined

2012-11-09 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1751:
--

Attachment: TServer_guard.patch

Guarding increase_max_fds definition with HAVE_SYS_RESOURCE_H

 definition of increase_max_fds doesn't compile when HAVE_SYS_RESOURCE_H is 
 not defined
 --

 Key: THRIFT-1751
 URL: https://issues.apache.org/jira/browse/THRIFT-1751
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9, 1.0
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: TServer_guard.patch


 The definition of increase_max_fds uses struct rlimit, which is defined in 
 sys/resource.h.  If sys/resource.h doesn't get included, you get a compiler 
 error.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1750) Make compiler build cleanly under visual studio 10

2012-11-09 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13494337#comment-13494337
 ] 

Ben Craig commented on THRIFT-1750:
---

I will look in to making these changes work with that script.  It is possible 
that they already do, but I don't know enough about mingw to be sure.

 Make compiler build cleanly under visual studio 10
 --

 Key: THRIFT-1750
 URL: https://issues.apache.org/jira/browse/THRIFT-1750
 Project: Thrift
  Issue Type: Bug
  Components: Compiler (General)
Affects Versions: 0.9, 1.0
 Environment: Windows, MSVC10
Reporter: Ben Craig
 Fix For: 1.0

 Attachments: compiler_cleanup.patch


 Building the thrift compiler in Visual Studio 10 causes a lot of warnings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1740) Make C++ library build on OS X and iOS

2012-10-24 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1740:
-

 Summary: Make C++ library build on OS X and iOS
 Key: THRIFT-1740
 URL: https://issues.apache.org/jira/browse/THRIFT-1740
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Patch fixes OS X xcode 3.2 with gcc 4.2 toolchain.  Also 
fixes iOS xcode 4.4 with clang 4.0 toolchain.
Reporter: Ben Craig
 Fix For: 1.0, 0.9


Various small issues keep the existing Thrift c++ libraries from building on OS 
X and iOS.  For example, in Clang, there is no tr1/functional, only a regular 
functional.  Instead of adding a new configure token and a million #ifdefs, 
the patch has added a wrapper header that throws the relevant functional 
symbols into the apache::thrift:stdcxx namespace.

There are also several fixes for unused variable warnings in release mode.  I 
have added a helper macro to better document these cases (as opposed to just 
adding the mysterious ret=ret; everywhere).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1740) Make C++ library build on OS X and iOS

2012-10-24 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1740:
--

Attachment: mac_and_ios.patch

 Make C++ library build on OS X and iOS
 --

 Key: THRIFT-1740
 URL: https://issues.apache.org/jira/browse/THRIFT-1740
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Patch fixes OS X xcode 3.2 with gcc 4.2 toolchain.  Also 
 fixes iOS xcode 4.4 with clang 4.0 toolchain.
Reporter: Ben Craig
  Labels: c++, ios, mac
 Fix For: 0.9, 1.0

 Attachments: mac_and_ios.patch


 Various small issues keep the existing Thrift c++ libraries from building on 
 OS X and iOS.  For example, in Clang, there is no tr1/functional, only a 
 regular functional.  Instead of adding a new configure token and a million 
 #ifdefs, the patch has added a wrapper header that throws the relevant 
 functional symbols into the apache::thrift:stdcxx namespace.
 There are also several fixes for unused variable warnings in release mode.  I 
 have added a helper macro to better document these cases (as opposed to just 
 adding the mysterious ret=ret; everywhere).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1740) Make C++ library build on OS X and iOS

2012-10-24 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13483648#comment-13483648
 ] 

Ben Craig commented on THRIFT-1740:
---

The attached patch applies cleanly on 0.9 and the current 1.0-dev trunk.

 Make C++ library build on OS X and iOS
 --

 Key: THRIFT-1740
 URL: https://issues.apache.org/jira/browse/THRIFT-1740
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9, 1.0
 Environment: Patch fixes OS X xcode 3.2 with gcc 4.2 toolchain.  Also 
 fixes iOS xcode 4.4 with clang 4.0 toolchain.
Reporter: Ben Craig
  Labels: c++, ios, mac
 Fix For: 0.9, 1.0

 Attachments: mac_and_ios.patch


 Various small issues keep the existing Thrift c++ libraries from building on 
 OS X and iOS.  For example, in Clang, there is no tr1/functional, only a 
 regular functional.  Instead of adding a new configure token and a million 
 #ifdefs, the patch has added a wrapper header that throws the relevant 
 functional symbols into the apache::thrift:stdcxx namespace.
 There are also several fixes for unused variable warnings in release mode.  I 
 have added a helper macro to better document these cases (as opposed to just 
 adding the mysterious ret=ret; everywhere).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-10-05 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13470318#comment-13470318
 ] 

Ben Craig commented on THRIFT-1690:
---

One decent short term possibility is to change those two #ifdef linux's to 
#ifndef _WIN32.

A longer term solution is to stop providing unnatural aliases.  Turning int - 
SOCKET on non-Windows is one example.  Turning errno into WSAGetLastError is 
similarly bad on Windows.

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: libthrift_pipe_size.patch, libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-10-05 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1690:
--

Attachment: lib_socket_typedef.patch

Fix for non-linux, non-windows builds of C++ library.  Only tested on Linux and 
Windows, to make sure I didn't make things worse.

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: lib_socket_typedef.patch, libthrift_pipe_size.patch, 
 libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1695) allow warning-free compilation in VS 2012 and GNU 4.6

2012-10-05 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1695:
--

Attachment: compiler_warning_purge.patch

Merged all compiler related .patch files into one.

 allow warning-free compilation in VS 2012 and GNU 4.6
 -

 Key: THRIFT-1695
 URL: https://issues.apache.org/jira/browse/THRIFT-1695
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows and any Unix
Reporter: James K. Lowden
  Labels: patch
 Fix For: 1.0

 Attachments: compiler_is_dir.patch, compiler_switch_default.patch, 
 compiler_unused_locals.patch, compiler_warning_purge.patch, 
 libthrift_warning_purge.patch, platform_direct.patch, 
 thrift.warningfree.pax.gz

   Original Estimate: 24h
  Remaining Estimate: 24h

 The patches allow the current trunk of Thrift C++ to
 build without warnings in Visual Studio and GNU gcc.  
 I introduce THRIFT_SAFE_CAST in Thrift.h, which tests narrowing
 conversions for fit.  Would-be overflows throw std::runtime_error.  
 Some functions have been modified or overloaded to allow size_t
 parameters.  SOCKET is dealt with intelligently.  
 IMO every public thrift function should have a form accepting normal
 types -- including e.g. short, int, long, and size_t -- and apply casts
 as necessary.  In particular size_t is important because std
 constainers have size() members that usually return something like
 size_t.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1695) allow warning-free compilation in VS 2012 and GNU 4.6

2012-10-05 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13470500#comment-13470500
 ] 

Ben Craig commented on THRIFT-1695:
---

Recreated patch.  compiler_warning_purge.patch is the one you want.  Let me 
know if it causes you any problems.

 allow warning-free compilation in VS 2012 and GNU 4.6
 -

 Key: THRIFT-1695
 URL: https://issues.apache.org/jira/browse/THRIFT-1695
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows and any Unix
Reporter: James K. Lowden
  Labels: patch
 Fix For: 1.0

 Attachments: compiler_is_dir.patch, compiler_switch_default.patch, 
 compiler_unused_locals.patch, compiler_warning_purge.patch, 
 libthrift_warning_purge.patch, platform_direct.patch, 
 thrift.warningfree.pax.gz

   Original Estimate: 24h
  Remaining Estimate: 24h

 The patches allow the current trunk of Thrift C++ to
 build without warnings in Visual Studio and GNU gcc.  
 I introduce THRIFT_SAFE_CAST in Thrift.h, which tests narrowing
 conversions for fit.  Would-be overflows throw std::runtime_error.  
 Some functions have been modified or overloaded to allow size_t
 parameters.  SOCKET is dealt with intelligently.  
 IMO every public thrift function should have a form accepting normal
 types -- including e.g. short, int, long, and size_t -- and apply casts
 as necessary.  In particular size_t is important because std
 constainers have size() members that usually return something like
 size_t.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-10-04 Thread Ben Craig (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469653#comment-13469653
 ] 

Ben Craig commented on THRIFT-1690:
---

Roger,
I will be glad to better follow process in the future.  I'm not sure what I 
messed up with my last submission though.  What should I do better in the 
future?  Single .patch for the entire fix?  Remove the commentary in the .patch 
file?

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
Assignee: Roger Meier
 Attachments: libthrift_pipe_size.patch, libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-09-19 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1690:
--

Attachment: libthrift_warning_purge.patch
libthrift_pipe_size.patch

libthrift_pipe_size resolves pipe specific issues.

libthrift_warning_purge resolves a lot of issues.  Specifics are mentioned in 
the prologue of the .patch itself.

This is related to THRIFT-1695.  libthrift_warning_purge is also linked on 
THRIFT-1695.

 Sockets and Pipe Handles truncated on Win64
 ---

 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig
 Attachments: libthrift_pipe_size.patch, libthrift_warning_purge.patch

   Original Estimate: 48h
  Remaining Estimate: 48h

 On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.
 All of the files dealing with sockets in thrift use int as the type of a 
 socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
 portability, a SOCKET typedef is probably needed.
 For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
 member variables for some reason (maybe to avoid #including windows.h in a 
 header?).
 Both of these situations can result in invalid handles being used (and valid 
 handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1695) allow warning-free compilation in VS 2012 and GNU 4.6

2012-09-17 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1695:
--

Attachment: platform_direct.patch
libthrift_warning_purge.patch
compiler_unused_locals.patch
compiler_switch_default.patch
compiler_is_dir.patch

libthrift_warning_purge is very similar in spirit to James K. Lowden's patch.  
On the plus side, I believe it handles the socket types better.  On the down 
side, it handles the cast overflows in a one-off fashion, instead of making a 
centralized macro.

compiler_is_dir, compiler_unused_locals, and platform_direct are all there to 
make the compiler build without warnings.

compiler_switch_default changes generated C++ code so that consumers of that 
code don't have warnings in their build.

 allow warning-free compilation in VS 2012 and GNU 4.6
 -

 Key: THRIFT-1695
 URL: https://issues.apache.org/jira/browse/THRIFT-1695
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.9
 Environment: Windows and any Unix
Reporter: James K. Lowden
  Labels: patch
 Fix For: 0.9

 Attachments: compiler_is_dir.patch, compiler_switch_default.patch, 
 compiler_unused_locals.patch, libthrift_warning_purge.patch, 
 platform_direct.patch, thrift.warningfree.pax.gz

   Original Estimate: 24h
  Remaining Estimate: 24h

 The patches allow the current trunk of Thrift C++ to
 build without warnings in Visual Studio and GNU gcc.  
 I introduce THRIFT_SAFE_CAST in Thrift.h, which tests narrowing
 conversions for fit.  Would-be overflows throw std::runtime_error.  
 Some functions have been modified or overloaded to allow size_t
 parameters.  SOCKET is dealt with intelligently.  
 IMO every public thrift function should have a form accepting normal
 types -- including e.g. short, int, long, and size_t -- and apply casts
 as necessary.  In particular size_t is important because std
 constainers have size() members that usually return something like
 size_t.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64

2012-09-10 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1690:
-

 Summary: Sockets and Pipe Handles truncated on Win64
 Key: THRIFT-1690
 URL: https://issues.apache.org/jira/browse/THRIFT-1690
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: 64-bit Windows
Reporter: Ben Craig


On 64-bit Windows, int is a 32-bit value.  SOCKET and HANDLE are 64-bit.

All of the files dealing with sockets in thrift use int as the type of a 
socket, as this is the idiomatic way to handle sockets on POSIX systems.  For 
portability, a SOCKET typedef is probably needed.

For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as 
member variables for some reason (maybe to avoid #including windows.h in a 
header?).

Both of these situations can result in invalid handles being used (and valid 
handles being leaked) when the system is under load.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1692) SO_REUSEADDR allows for socket hijacking on Windows

2012-09-10 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1692:
-

 Summary: SO_REUSEADDR allows for socket hijacking on Windows
 Key: THRIFT-1692
 URL: https://issues.apache.org/jira/browse/THRIFT-1692
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.8, 0.9
 Environment: Worst on WinXP, slightly less bad on Win Server 2003+
Reporter: Ben Craig
 Fix For: 0.9


SO_REUSEADDR is a fine idea for sockets on POSIX operating systems. 
SO_REUSEADDR on Windows operates differently though.  This MSDN article 
explains the behavior:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx

Long story short, with SO_REUSEADDR, a hostile process owned by another user 
can steal your port.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1686) t_php_generator.cc uses and instead of , and causes compiler errors with Visual Studio

2012-09-06 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1686:
-

 Summary: t_php_generator.cc uses and instead of , and causes 
compiler errors with Visual Studio
 Key: THRIFT-1686
 URL: https://issues.apache.org/jira/browse/THRIFT-1686
 Project: Thrift
  Issue Type: Bug
  Components: PHP - Compiler
Affects Versions: 0.9
 Environment: Visual Studio 2010.
Reporter: Ben Craig
 Fix For: 0.9


t_php_generator.cc uses and instead of , and causes compiler errors with 
Visual Studio 2010.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1686) t_php_generator.cc uses and instead of , and causes compiler errors with Visual Studio

2012-09-06 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1686:
--

Description: 
t_php_generator.cc uses and instead of , and causes compiler errors with 
Visual Studio 2010.



  was:t_php_generator.cc uses and instead of , and causes compiler errors 
with Visual Studio 2010.


 t_php_generator.cc uses and instead of , and causes compiler errors 
 with Visual Studio
 

 Key: THRIFT-1686
 URL: https://issues.apache.org/jira/browse/THRIFT-1686
 Project: Thrift
  Issue Type: Bug
  Components: PHP - Compiler
Affects Versions: 0.9
 Environment: Visual Studio 2010.
Reporter: Ben Craig
 Fix For: 0.9

 Attachments: php_and_error.patch


 t_php_generator.cc uses and instead of , and causes compiler errors 
 with Visual Studio 2010.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1686) t_php_generator.cc uses and instead of , and causes compiler errors with Visual Studio

2012-09-06 Thread Ben Craig (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Craig updated THRIFT-1686:
--

Attachment: php_and_error.patch

Patch for php compiler error

 t_php_generator.cc uses and instead of , and causes compiler errors 
 with Visual Studio
 

 Key: THRIFT-1686
 URL: https://issues.apache.org/jira/browse/THRIFT-1686
 Project: Thrift
  Issue Type: Bug
  Components: PHP - Compiler
Affects Versions: 0.9
 Environment: Visual Studio 2010.
Reporter: Ben Craig
 Fix For: 0.9

 Attachments: php_and_error.patch


 t_php_generator.cc uses and instead of , and causes compiler errors 
 with Visual Studio 2010.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1687) Use Microsoft SafeInt (or reasonable alternative) to protect against integer arithmetic attacks

2012-09-06 Thread Ben Craig (JIRA)
Ben Craig created THRIFT-1687:
-

 Summary: Use Microsoft SafeInt (or reasonable alternative) to 
protect against integer arithmetic attacks
 Key: THRIFT-1687
 URL: https://issues.apache.org/jira/browse/THRIFT-1687
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Library
Affects Versions: 0.8, 0.9
 Environment: This is a concern on all OSes.  Microsoft SafeInt works 
on the major desktop OSes.
Reporter: Ben Craig


There are a lot of scary casts and integer truncations in the C++ Thrift 
library.  Microsoft has a template class that will throw an exception when any 
kind of integer overflow has happened ( http://safeint.codeplex.com/ ).  
SafeInt is released under the Microsoft Public License, which ASF has deemed 
suitable as a dependency for Apache products ( 
http://www.apache.org/legal/resolved.html#category-a ).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


<    1   2   3   4