diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-11-11 17:27:01 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-11-11 17:43:37 (GMT) |
commit | d16fcbc6d6b00770a5106027c24ed7cf7e92c1d5 (patch) | |
tree | 13f69453c5d3581b04375cd4ee722656994297a9 /src/network | |
parent | 9a5b72eb64d698aff507d5c2b2ea6d19bda0b65e (diff) | |
download | Qt-d16fcbc6d6b00770a5106027c24ed7cf7e92c1d5.zip Qt-d16fcbc6d6b00770a5106027c24ed7cf7e92c1d5.tar.gz Qt-d16fcbc6d6b00770a5106027c24ed7cf7e92c1d5.tar.bz2 |
SSL: Fix for systemCaCertificates being called first on symbian
On symbian, thread names must be unique (actually kernel object names)
When a thread exits, there may still be open handles, for example a
debugger or RUndertaker so the thread name cannot be reused immediately.
S60 has an RUndertaker instance in a background thread, which is used
to display the "application closed" messages when a crash happens.
Until that thread has run and checked the thread exit to see if it was
a crash or not, the thread remains open.
When systemCaCertificates is called as the first API call, it calls itself
via ensureinitialised() to set the default CA certs. This double call
should be addressed by QTBUG-15218.
In any case, QSslSocket::systemCaCertificates() is intended to refresh
from the system - if application code calls it too quickly in succession it
could also trigger this bug.
Task-number: QTBUG-15126
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 426b07a..f4bd423 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -659,8 +659,16 @@ TInt CSymbianCertificateRetriever::ThreadEntryPoint(TAny* aParams) void CSymbianCertificateRetriever::ConstructL() { - User::LeaveIfError(iThread.Create(_L("CertWorkerThread"), - CSymbianCertificateRetriever::ThreadEntryPoint, 16384, NULL, this)); + TInt err; + int i=0; + QString name(QLatin1String("CertWorkerThread-%1")); + //recently closed thread names remain in use for a while until all handles have been closed + //including users of RUndertaker + do { + err = iThread.Create(qt_QString2TPtrC(name.arg(i++)), + CSymbianCertificateRetriever::ThreadEntryPoint, 16384, NULL, this); + } while (err == KErrAlreadyExists); + User::LeaveIfError(err); } void CSymbianCertificateRetriever::DoCancel() |