Commit Graph

4652 Commits

Author SHA1 Message Date
Alex Fabijanic
900426e52b fix sqlite close logic 2017-08-13 21:29:11 -05:00
Yasuhiro Horimoto
e144a1ffbc Fix issues #1373 for ODBC (#1837)
* Fix issues #1373 for ODBC

* Fix coding style and typo in `SessionImpl::close()`
2017-08-11 20:50:16 +02:00
Günter Obiltschnig
66a7fc6652 fixed GH #1826: XPath query error 2017-08-11 19:28:59 +02:00
Günter Obiltschnig
f8b7681f78 fixed GH #1813: xmlparse.cpp doesn't compile in WinCE (poco 1.7.8p3) 2017-08-10 16:58:44 +02:00
Günter Obiltschnig
88684a182f revert naming changes 2017-08-10 13:06:13 +02:00
Günter Obiltschnig
be90443748 use random salt in NamePool hash table 2017-08-10 13:05:38 +02:00
Günter Obiltschnig
1bcf8f1011 upgrade bundled expat to 2.2.3 2017-08-10 13:04:59 +02:00
sebastien-guay
a9982e68ba "SocketReactor::addEventHandler" and "SocketReactor::removeEventHandler" must protect the access to "NotifierPtr pNotifier" (#1709)
Those two methods already use FastMutex::ScopedLock lock(_mutex), but
the scope is not large enough to protect "NotifierPtr pNotifier" that is
accessed by calling SocketNotifier::addObserver() and
SocketNotifier::removeObserver().

It is mentioned in SocketReator.h that it is safe to call
addEventHandler() and removeEventHandler() from another thread while the
SocketReactor is running. My current use of the SocketReactor
encountered an issue where the SocketNotifier::_events has been
corrupted by a concurent write access done by
SocketReactor::addEventHandler() and
SocketReactor::removeEventHandler().
The call stack show that the SocketReactor::addEventHandler is stuck in
a while loop in gcc/libstdc++/tree.cc Rb_tree_insert_and_rebalance()

I clearly see in my logs that it happened while my
SocketConnector::unregisterConnector() and
SocketConnector::registerConnector() were called by two different
threads.

#0 0x00a80a7b in std::_Rb_tree_insert_and_rebalance () from
/usr/lib/libstdc++.so.6
#1 0x06ccb430 in std::_Rb_tree<Poco::Net::SocketNotification*,
Poco::Net::SocketNotification*,
std::_IdentityPoco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::_M_insert
(this=0xac75dc90, __x=0x0, __p=0xac7ed0c8, __v=@0xb5fb0c40) at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:816
#2 0x06ccb15d in std::_Rb_tree<Poco::Net::SocketNotification*,
Poco::Net::SocketNotification*,
std::_IdentityPoco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::insert_equal
(this=0xac75dc90, __v=@0xb5fb0c40) at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:858
#3 0x06ccad86 in std::multiset<Poco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::insert (this=0xac75dc90,
__x=@0xb5fb0c40)
at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h:306
#4 0x06cca72b in Poco::Net::SocketNotifier::addObserver
(this=0xac75dc70, pReactor=0x8d27958, observer=@0xb5fb0cd0) at
src/SocketNotifier.cpp:45
#5 0x06cd060f in Poco::Net::SocketReactor::addEventHandler
(this=0x8d27958, socket=@0xac7f5a74, observer=@0xb5fb0cd0) at
src/SocketReactor.cpp:178

SocketReactor::run() is already protecting the access to the
SocketNotifier.
2017-08-10 10:10:09 +02:00
TimTim
5b7d9d2b18 avoid multipart boundary conflict (#1753)
when nesting multipart, descendant parts currently may have the same boundary as the top-level multipart.
2017-08-10 10:07:19 +02:00
Alexander B
453d5248f1 Poco Path and simbol $ (#1800)
* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY

* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY, try 50 times with 100ms sleeping

* bug : into current implementation od path_unix.cpp I can't use simbol $ like a simbol, not a variable prefix, for example,
I need to use path /home/user/O1$$/folder. I propose to use escape sequence for this, for ex., if I want to use Poco::Glob, I can do
std::set<std::string> files;
std::string path = "/home/user/O1$$/folder"
Poco::replaceInPlace(path, "$", "\\$");
Poco::Glob::glob(path, files);

* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY, try 50 times with 100ms sleeping (fix code style)

bug : into current implementation od path_unix.cpp I can't use simbol $ like a simbol, not a variable prefix, for example,
I need to use path /home/user/O1$$/folder. I propose to use escape sequence for this, for ex., if I want to use Poco::Glob, I can do
std::set<std::string> files;
std::string path = "/home/user/O1$$/folder"
Poco::replaceInPlace(path, "$", "\\$");
Poco::Glob::glob(path, files);

add test

* fix : try to finalize stmt if its busy (on close session)

* fix : try to finalize stmt if its busy (on close session)
2017-08-10 10:00:06 +02:00
micheleselea
5fe775dfc3 SQlite 3.19.3 and Socket::select fix (#1825)
* SQlite 3.19.3

changelog
http://www.sqlite.org/releaselog/3_19_3.html

* epoll_event memset fix

with -std=c++14 the sizeof(eventsIn) give as result the number of array elements not the bytes number, so the memset is wrong

* fix for older gcc

on older version of gcc struct epoll_event eventsOut[epollSize] = { 0 }; does not compile
2017-07-25 14:20:19 +02:00
Alex Fabijanic
f193a82f20 fix warning and compile error 2017-07-24 15:36:37 +02:00
was4444
303e398803 [Format] add variable width support (#1743)
* add variable width test cases

* add variable width support

* update the documentation for variable width
2017-07-24 12:21:35 +02:00
Yasuhiro Horimoto
fd1d113acb Fix VisualStudio warning C4245 in NetworkInterface.h (#1823) 2017-07-23 21:09:57 +02:00
zosrothko
7bf53d4f3f c++11 support: update the develop branch (#1819)
* Use appveyor.yaml from c++11 branch so that CI run ok.

* Use .travis.yml from the c++ branch so that Travis CI jobs run ok.

* Add c++11 scripts and Linux config so that Travis CI jobs are ok.

* Use mkdocumentation & mkrelease from c++11 branch.

* Use PocoDoc config files from c++11 branch.

* define POCO_ENABLE_C11 as the default

* CMake: ignore Crypto for now. To be fixed since it fails.

* Backport c++11 changes from the c++11 branch

* Add Cygwin config with c++11 setup.

* Update appveyor.yml from c++11 branch.
2017-07-23 21:09:22 +02:00
Luis Martinez de Bartolome Izquierdo
63447f0297 Deleted biicode folder (#1821)
* Deleted biicode folder

* Removed Biicode comment too
2017-07-21 12:18:31 +02:00
Yasuhiro Horimoto
a767d55a81 Fixed integer overflow in sessionimpl.cpp (#1803) (#1820)
* Fix integer overflow in sessionimpl.cpp

* Modify document of setConnectionTimeout

Add discription of exception.
2017-07-20 15:25:22 +02:00
David Hedbor
40324cdcc0 Fix OpenSSLInitialized thread safety (#1739) (#1740)
* Fix OpenSSLInitialized thread safety (#1739)

The init/uninit methods can be called from multiple threads, and thus need synchronization with a mutex.

* Renamed mutex variable and use ScopedLock.

* Change reference count variable to be an integer, since it’s protected by a mutex and no longer needs to be atomic.
2017-07-18 15:57:58 +02:00
komainu8
b59d74cfb5 Improve launchImpl in Process_WIN32.cpp (#1799) 2017-07-17 14:11:43 +02:00
komainu8
1e4ee012a2 Improve convert to big-endian from little-endian (#1804) (#1815) 2017-07-17 09:59:28 +02:00
Günter Obiltschnig
f2bb0570c9 Merge pull request #1809 from alterratz/develop
make RecordSet::reset(stmt) return a reference to itself
2017-07-12 15:45:56 +02:00
Bernhard Rieder
115edb9605 make RecordSet::reset(stmt) return a reference to itself 2017-07-12 11:10:17 +02:00
Alex Fabijanic
bc27086003 fix 32bit SQLite tests 2017-07-11 10:04:12 +02:00
Matt Tucker
4da941f869 TCPServerDispatcher: fix thread accounting leak (#1801)
* TCPServerDispatcher::run: catch errors in connection creation and handling to prevent threads from exiting without accounting for them
2017-07-10 22:37:11 +02:00
Alex Fabijanic
6c13f5d14c fix odbc build on linux 2017-07-06 19:50:15 +02:00
Alex Fabijanic
c271e49247 force mysql tcp connection; fix failing tests 2017-07-06 19:11:23 +02:00
Craig Scott
035177e1d2 Add POCO_VERBOSE_MESSAGES option (#1679)
Allows informational logging to be turned off. All find-related messages,
warnings, errors, etc. are still always logged. The option is ON by default
to preserve existing behaviour.
2017-07-06 15:56:39 +02:00
jnytra
f8bacb47b5 Fixed GH #1155: Select from MySQL table with longtext column causes SIGSEGV (#1164) 2017-07-06 00:44:21 +02:00
Thomas Köppe
15c076b3ea [CppUnit/RepeatedTest.h] Add missing return type (#1273) 2017-07-06 00:36:51 +02:00
Andreas Martin
af4f2df66b Fix misplaced RedisEventArgs.cpp/.h (#1509) 2017-07-06 00:23:25 +02:00
Stefan Weil
8ccee8928c Fix typos in comments, documentation and strings (#1615)
All of them were found using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-07-06 00:17:38 +02:00
andred
a9598960e4 Error: simplify strerror_r() handling (#1647)
This is a simpler version of the existing strerror_r()
handling.

Idea borrowed from boost.asio:
  443bc17d13
2017-07-06 00:14:00 +02:00
Orlin Hristov
262079b0f0 Fix for issue #1043 (#1725)
* Fix for issue #1043

The fix for this issue was partially implemented in development branch.
However, there are still some issue, that were not covered:
1. The std::string overload will sets SQL_LONGVARCHAR as fSqlType if the
output parameter is of type VARCHAR(MAX)
2. The UTF16String overload of bind method:
a) always resolves fSqlType using the size of formal parameter const
std::string& val.
b) allocates half of the size of the SP's output parameter.
3. The _utf16Strings member is not sychronized in Binder::synchronize()
method.
4. The _utf16Strings member is not reset in Binder::reset() method.

* Fixed compiler error for GCC

Fixed compiler error caused by improper getting of UTF16String length in
Binder::synchronize()

* Fix input param initialization in unit test
2017-07-06 00:06:10 +02:00
OgreTransporter
3dfcc83257 Add workarround to handle static OpenSSL libs on Windows with CMake, fix NetSSL_Win samples and testsuite (#1733)
* Add workarround to handle static OpenSSL libs on Windows with CMake

* Fix NetSSL_Win samples and testsuite
2017-07-06 00:02:22 +02:00
zosrothko
62af826c88 When not defined, default VS150COMNTOOLS to C:\Program Files (#1787)
(x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
See 
https://developercommunity.visualstudio.com/content/problem/13223/no-environmental-variable-vscomntools150.html
2017-07-05 23:58:19 +02:00
Alex Fabijanic
128c5c57eb rename 'separator' to 'frac'; develop: PostgreSQLTest: missing ExecUtil class #1788 2017-07-05 11:55:05 +02:00
Marian Krivoš
7f193697db Try to save the type for Var with Json serialize/deserialize (#1703)
* Fix JSON to Var parsing (save the type)

* fix formatting

* remove redundant include <iostream>

* fix c++98 compatibility
2017-07-03 23:33:32 +02:00
Alex Fabijanic
3ec9316ab0 localtime_r is not part of C++ #1746 2017-07-03 22:37:32 +02:00
Alex Fabijanic
72b826651f src/Var.cpp: 2 * sanity check in wrong place ? #1784 2017-07-03 21:03:50 +02:00
Alex Fabijanic
34826e3797 fix RowFilter refcount 2017-07-03 17:32:28 +02:00
Iskandar Safarov
d7d6b739a2 Exception in destructor (#1777)
* The destructor of BasicBufferedStreamBuf() calls Allocator::deallocate which can throw exceptions. In particular it throws Poco::SystemException when can't lock mutex.

* Added poco_unexpected(); into exception handler
2017-07-02 20:04:58 +02:00
Aleksandar Fabijanic
a33057d8fe Merge pull request #1778 from pocoproject/internal-ext-fix
ODBC RecordSet (internal extraction) broken #1775
2017-06-30 16:53:50 +02:00
Alex Fabijanic
5cad99a704 fix test table name 2017-06-30 16:51:07 +02:00
Alex Fabijanic
96bb22621e fix RowFilter refcounting, some cleanup 2017-06-30 16:13:56 +02:00
Alex Fabijanic
41e3f38c06 ODBC RecordSet (internal extraction) broken #1775; some style fixes 2017-06-29 23:49:42 +02:00
Alex Fabijanic
b3704e2275 add type diagnostics 2017-06-28 17:21:49 +02:00
Alex Fabijanic
12f61b8ccf Wrong limit check in Poco::Dynamic::Var #996 2017-06-27 18:33:48 +02:00
Alex Fabijanic
848d510fae simplify g++ check 2017-06-27 12:59:06 +02:00
Aleksandar Fabijanic
5d69bae19f Poco::Data::SQLite data types #703 (#1767) 2017-06-27 12:15:24 +02:00
Alex Fabijanic
4b4adb4459 fix clang warning 2017-06-27 11:58:50 +02:00