mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
Merge branch 'develop' of https://github.com/pocoproject/poco into develop
This commit is contained in:
commit
d3c8ec01f8
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,6 +86,9 @@ public:
|
||||
///
|
||||
/// Returns true if the STARTTLS command was successful,
|
||||
/// false otherwise.
|
||||
|
||||
private:
|
||||
std::string _host;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user