BaoLinden avatar BaoLinden committed f8d7351

fix a mac build error: a friend declaration issue.

Comments (0)

Files changed (2)

indra/llmessage/llcurl.cpp

 
 //------------------------------------------------------------
 //LLCurlThread
-LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi) :
+LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread) :
 	LLQueuedThread::QueuedRequest(handle, LLQueuedThread::PRIORITY_NORMAL, FLAG_AUTO_COMPLETE),
-	mMulti(multi)
+	mMulti(multi),
+	mCurlThread(curl_thread)
 {	
 }
 
 {	
 	if(mMulti)
 	{
-		delete mMulti ;
+		mCurlThread->deleteMulti(mMulti) ;
 		mMulti = NULL ;
 	}
 }
 	bool completed = true ;
 	if(mMulti)
 	{
-		completed = mMulti->doPerform() ;
+		completed = mCurlThread->doMultiPerform(mMulti) ;
 		setPriority(LLQueuedThread::PRIORITY_LOW) ;
 	}
 
 
 void LLCurlThread::CurlRequest::finishRequest(bool completed)
 {
-	delete mMulti ;
+	mCurlThread->deleteMulti(mMulti) ;
 	mMulti = NULL ;
 }
 	
 {
 	multi->mHandle = generateHandle() ;
 
-	CurlRequest* req = new CurlRequest(multi->mHandle, multi) ;
+	CurlRequest* req = new CurlRequest(multi->mHandle, multi, this) ;
 
 	if (!addRequest(req))
 	{
 	}
 }
 	
-void LLCurlThread::deleteMulti(LLCurl::Multi* multi)
+void LLCurlThread::killMulti(LLCurl::Multi* multi)
 {
 	multi->markDead() ;
 }
 
+//private
+bool LLCurlThread::doMultiPerform(LLCurl::Multi* multi) 
+{
+	return multi->doPerform() ;
+}
+
+//private
+void LLCurlThread::deleteMulti(LLCurl::Multi* multi) 
+{
+	delete multi ;
+}
 //------------------------------------------------------------
 
 //static
 	//stop all Multi handle background threads
 	for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter)
 	{
-		LLCurl::getCurlThread()->deleteMulti(*iter) ;
+		LLCurl::getCurlThread()->killMulti(*iter) ;
 	}
 	mMultiSet.clear() ;
 }
 		if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0)
 		{
 			mMultiSet.erase(curiter);
-			LLCurl::getCurlThread()->deleteMulti(multi);
+			LLCurl::getCurlThread()->killMulti(multi);
 		}
 	}
 	mProcessing = FALSE;
 
 LLCurlEasyRequest::~LLCurlEasyRequest()
 {
-	LLCurl::getCurlThread()->deleteMulti(mMulti) ;
+	LLCurl::getCurlThread()->killMulti(mMulti) ;
 }
 	
 void LLCurlEasyRequest::setopt(CURLoption option, S32 value)

indra/llmessage/llcurl.h

 		virtual ~CurlRequest(); // use deleteRequest()
 		
 	public:
-		CurlRequest(handle_t handle, LLCurl::Multi* multi);
+		CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread);
 
 		/*virtual*/ bool processRequest();
 		/*virtual*/ void finishRequest(bool completed);
 	private:
 		// input
 		LLCurl::Multi* mMulti;
+		LLCurlThread*  mCurlThread;
 	};
-	
+	friend class CurlRequest;
+
 public:
 	LLCurlThread(bool threaded = true) ;
 	virtual ~LLCurlThread() ;
 	S32 update(U32 max_time_ms);
 
 	void addMulti(LLCurl::Multi* multi) ;
+	void killMulti(LLCurl::Multi* multi) ;
+
+private:
+	bool doMultiPerform(LLCurl::Multi* multi) ;
 	void deleteMulti(LLCurl::Multi* multi) ;
 } ;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.