Merge branch 'develop' of https://github.com/pocoproject/poco into develop

This commit is contained in:
Alex Fabijanic 2014-05-13 04:06:31 -05:00
commit d3c8ec01f8
3 changed files with 29 additions and 2 deletions

View File

@ -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<CLOB> 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));
}
}

View File

@ -86,6 +86,9 @@ public:
///
/// Returns true if the STARTTLS command was successful,
/// false otherwise.
private:
std::string _host;
};

View File

@ -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;