Merge branch 'curlthreading2' into curlthreading3

This commit is contained in:
Aleric Inglewood
2012-09-11 17:05:13 +02:00
2 changed files with 6 additions and 2 deletions

View File

@@ -1132,6 +1132,7 @@ CURLcode CurlEasyRequest::curlCtxCallback(CURL* curl, void* sslctx, void* parm)
// Also turn off SSL v2, which is highly broken and strongly discouraged[1]. // Also turn off SSL v2, which is highly broken and strongly discouraged[1].
// [1] http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html#SECURE_RENEGOTIATION // [1] http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html#SECURE_RENEGOTIATION
long options = SSL_OP_NO_SSLv2; long options = SSL_OP_NO_SSLv2;
#ifdef SSL_OP_NO_TLSv1_1 // Only defined for openssl version 1.0.1 and up.
if (need_renegotiation_hack) if (need_renegotiation_hack)
{ {
// This option disables openssl to use TLS version 1.1. // This option disables openssl to use TLS version 1.1.
@@ -1145,6 +1146,9 @@ CURLcode CurlEasyRequest::curlCtxCallback(CURL* curl, void* sslctx, void* parm)
// which finishes the negotiation and ends with 'Verify return code: 0 (ok)' // which finishes the negotiation and ends with 'Verify return code: 0 (ok)'
options |= SSL_OP_NO_TLSv1_1; options |= SSL_OP_NO_TLSv1_1;
} }
#else
llassert_always(!need_renegotiation_hack);
#endif
SSL_CTX_set_options(ctx, options); SSL_CTX_set_options(ctx, options);
return CURLE_OK; return CURLE_OK;
} }

View File

@@ -510,12 +510,12 @@ void AIStateMachine::dowork(void)
AIStateMachine& statemachine(iter->statemachine()); AIStateMachine& statemachine(iter->statemachine());
if (!statemachine.mIdle) if (!statemachine.mIdle)
{ {
U64 start = LLFastTimer::getCPUClockCount64(); U64 start = get_clock_count();
// This might call idle() and then pass the statemachine to another thread who then may call cont(). // This might call idle() and then pass the statemachine to another thread who then may call cont().
// Hence, after this isn't not sure what mIdle is, and it can change from true to false at any moment, // Hence, after this isn't not sure what mIdle is, and it can change from true to false at any moment,
// if it is true after this function returns. // if it is true after this function returns.
statemachine.multiplex(start); statemachine.multiplex(start);
U64 delta = LLFastTimer::getCPUClockCount64() - start; U64 delta = get_clock_count() - start;
iter->add(delta); iter->add(delta);
total_clocks += delta; total_clocks += delta;
if (total_clocks >= sMaxCount) if (total_clocks >= sMaxCount)