コード例 #1
0
ファイル: llcurl.cpp プロジェクト: HizWylder/GIS
S32 LLCurl::Multi::process()
{
	if(!isValid())
	{
		return 0 ;
	}

	waitToComplete() ;

	if (getState() != STATE_COMPLETED)
	{
		return 0;
	}

	CURLMsg* msg;
	int msgs_in_queue;

	S32 processed = 0;
	while ((msg = info_read(&msgs_in_queue)))
	{
		++processed;
		if (msg->msg == CURLMSG_DONE)
		{
			U32 response = 0;
			Easy* easy = NULL ;

			{
				LLMutexLock lock(mEasyMutexp) ;
				easy_active_map_t::iterator iter = mEasyActiveMap.find(msg->easy_handle);
				if (iter != mEasyActiveMap.end())
				{
					easy = iter->second;
				}
			}

			if(easy)
			{
				response = easy->report(msg->data.result);
				removeEasy(easy);
			}
			else
			{
				response = 499;
				//*TODO: change to llwarns
				llerrs << "cleaned up curl request completed!" << llendl;
			}
			if (response >= 400)
			{
				// failure of some sort, inc mErrorCount for debugging and flagging multi for destruction
				++mErrorCount;
			}
		}
	}

	setState(STATE_READY);

	return processed;
}
コード例 #2
0
ファイル: user.cpp プロジェクト: aaleksandar/si2os1
	~Consumer() {waitToComplete();}
コード例 #3
0
ファイル: user.cpp プロジェクト: aaleksandar/si2os1
	~Producer() {waitToComplete();}