From e781870da35ab1adef68146bfbd6e37065577986 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 17 Nov 2012 04:55:34 +0100 Subject: [PATCH] Fix Ratany Residents crash --- indra/llmessage/aicurlprivate.h | 3 ++- indra/llmessage/aicurlthread.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index a1d449998..327637a3d 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -376,7 +376,8 @@ class CurlEasyRequest : public CurlEasyHandle { // This creates mTimeout (unless mTimeoutIsOrphan is set in which case it adopts the orphan). LLPointer& get_timeout_object(ThreadSafeBufferedCurlEasyRequest* lockobj); // Accessor for mTimeout with optional creation of orphaned object (if lockobj != NULL). - LLPointer& httptimeout(ThreadSafeBufferedCurlEasyRequest* lockobj = NULL) { if (lockobj && !mTimeout) create_timeout_object(lockobj); return mTimeout; } + LLPointer& httptimeout(ThreadSafeBufferedCurlEasyRequest* lockobj = NULL) + { if (lockobj && !mTimeout) { create_timeout_object(lockobj); mTimeoutIsOrphan = true; } return mTimeout; } // Return true if no data has been received on the latest socket (if any) for too long. bool has_stalled(void) const { return mTimeout && mTimeout->has_stalled(); } diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 55e891137..0b4a6e121 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -2284,7 +2284,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size char const* const header_line = static_cast(data); size_t const header_len = size * nmemb; - if (self_w->httptimeout()->data_received(header_len)) // Update timeout administration. + if (self_w->httptimeout(lockobj)->data_received(header_len)) // Update timeout administration. { // Transfer timed out. Return 0 which will abort with error CURLE_WRITE_ERROR. return 0;