From e4484db61ee34d49f6c5b5701d3e1eb138dd6143 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Sun, 11 May 2014 22:12:49 -0500 Subject: [PATCH 1/2] Attempt to reproduce GH #261 (select into BLOB; the value of all BLOB records are same.) --- Data/SQLite/testsuite/src/SQLiteTest.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Data/SQLite/testsuite/src/SQLiteTest.cpp b/Data/SQLite/testsuite/src/SQLiteTest.cpp index 47368f534..9a2fe36eb 100755 --- a/Data/SQLite/testsuite/src/SQLiteTest.cpp +++ b/Data/SQLite/testsuite/src/SQLiteTest.cpp @@ -1376,6 +1376,29 @@ void SQLiteTest::testCLOB() tmp << "SELECT Image FROM Person WHERE LastName == :ln", bind("lastname"), into(res), now; poco_assert (res == img); + + tmp << "DROP TABLE IF EXISTS BlobTest", now; + std::vector resVec; + const int arrSize = 10; + char val[arrSize]; + for (int i = 0; i < arrSize; ++i) + { + val[i] = (char) (0x30 + i); + } + + for (int i = 0; i < arrSize; ++i) + { + tmp << "CREATE TABLE IF NOT EXISTS BlobTest (idx INTEGER(2), Image BLOB)", now; + val[0] = (char) (0x30 + i); + img.assignRaw(val, arrSize); + tmp << "INSERT INTO BlobTest VALUES(?, ?)", use(i), use(img), now; + } + tmp << "SELECT Image FROM BlobTest", into(resVec), now; + poco_assert(resVec.size() == arrSize); + for (int i = 0; i < arrSize; ++i) + { + poco_assert(*resVec[i].begin() == (char) (0x30 + i)); + } } From 2341a1d23611bd875d7603564012f0eb47c21bb5 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Mon, 12 May 2014 16:01:56 +0200 Subject: [PATCH 2/2] SecureSMTPClientSession bugfix: save hostname for cert validation --- NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h | 3 +++ NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h b/NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h index 9b38a1b07..bca3b7b7c 100755 --- a/NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h @@ -86,6 +86,9 @@ public: /// /// Returns true if the STARTTLS command was successful, /// false otherwise. + +private: + std::string _host; }; diff --git a/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp b/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp index f8501a5a2..b441e8184 100755 --- a/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp +++ b/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp @@ -31,7 +31,8 @@ SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket): SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port): - SMTPClientSession(host, port) + SMTPClientSession(host, port), + _host(host) { } @@ -55,7 +56,7 @@ bool SecureSMTPClientSession::startTLS(Context::Ptr pContext) status = sendCommand("STARTTLS", response); if (!isPositiveCompletion(status)) return false; - SecureStreamSocket sss(SecureStreamSocket::attach(socket(), pContext)); + SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext)); socket() = sss; return true;