• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LogLine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LogLine函数的典型用法代码示例。如果您正苦于以下问题:C++ LogLine函数的具体用法?C++ LogLine怎么用?C++ LogLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LogLine函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: strerror

LogMessage::~LogMessage() {
  // Finish constructing the message.
  if (data_->GetError() != -1) {
    data_->GetBuffer() << ": " << strerror(data_->GetError());
  }
  std::string msg(data_->ToString());

  {
    // Do the actual logging with the lock held.
    lock_guard<mutex> lock(logging_lock);
    if (msg.find('\n') == std::string::npos) {
      LogLine(data_->GetFile(), data_->GetLineNumber(), data_->GetId(),
              data_->GetSeverity(), msg.c_str());
    } else {
      msg += '\n';
      size_t i = 0;
      while (i < msg.size()) {
        size_t nl = msg.find('\n', i);
        msg[nl] = '\0';
        LogLine(data_->GetFile(), data_->GetLineNumber(), data_->GetId(),
                data_->GetSeverity(), &msg[i]);
        i = nl + 1;
      }
    }
  }

  // Abort if necessary.
  if (data_->GetSeverity() == FATAL) {
#ifdef __ANDROID__
    android_set_abort_message(msg.c_str());
#endif
    abort();
  }
}
开发者ID:ArtBears,项目名称:platform_system_core,代码行数:34,代码来源:logging.cpp


示例2: ASSERT

void CKadOperation::LogReport(UINT Flags, const wstring& ErrorMessage, const string& Error, const CVariant& Trace)
{
	wstring Operation = L"Kad Operation";
	if(m_pOperator)
	{
		CKadScript* pKadScript = m_pOperator->GetScript();
		ASSERT(pKadScript);

		Operation += L" (" + pKadScript->GetName() + L" v" + CKadScript::GetVersion(pKadScript->GetVersion()) + L")";
	}
	
	if(Trace.Count() > 0) // remote result
	{
		wstring Sender = CUInt128(Trace.At((uint32)0)).ToHex();
		if(!Error.empty())
			LogLine(LOG_DEBUG | Flags, L"%s recived an Error: %s from %s", Operation.c_str(), ErrorMessage.c_str(), Sender.c_str());
		else
			LogLine(LOG_DEBUG | Flags, L"%s recived a Report: %s from %s", Operation.c_str(), ErrorMessage.c_str(), Sender.c_str());
	}
	else
	{
		if(!Error.empty())
			LogLine(LOG_DEBUG | Flags, L"%s caused an Error: %s", Operation.c_str(), ErrorMessage.c_str());
		else
			LogLine(LOG_DEBUG | Flags, L"%s Reports: %s", Operation.c_str(), ErrorMessage.c_str());
	}
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:27,代码来源:KadOperation.cpp


示例3: switch

void SoftwareAuthority::errorData(int err)
{
  switch((Q3Socket::Error)err) {
      case Q3Socket::ErrConnectionRefused:
	LogLine(RDConfig::LogNotice,QString().sprintf(
	  "Connection to SoftwareAuthority device at %s:%d refused, attempting reconnect",
		  (const char *)swa_ipaddress.toString(),
		  swa_ipport));
	swa_reconnect_timer->start(SWAUTHORITY_RECONNECT_INTERVAL,true);
	break;

      case Q3Socket::ErrHostNotFound:
	LogLine(RDConfig::LogWarning,QString().sprintf(
	  "Error on connection to SoftwareAuthority device at %s:%d: Host Not Found",
		  (const char *)swa_ipaddress.toString(),
		  swa_ipport));
	break;

      case Q3Socket::ErrSocketRead:
	LogLine(RDConfig::LogWarning,QString().sprintf(
	  "Error on connection to SoftwareAuthority device at %s:%d: Socket Read Error",
				  (const char *)swa_ipaddress.toString(),
				  swa_ipport));
	break;
  }
}
开发者ID:WMFO,项目名称:rivendell,代码行数:26,代码来源:swauthority.cpp


示例4: LogLine

void Harlond::ProcessResponse(const QString &str)
{
  //  LogLine(RDConfig::LogNotice,str);
  QStringList cmds=cmds.split(" ",str);

  if(cmds[0]=="PW") {
    if(cmds.size()==2) {
      if(cmds[1]=="+") {
	LogLine(RDConfig::LogInfo,tr("connection to harlond device at ")+
		bt_ip_address.toString()+QString().sprintf(":%d ",bt_tcp_port)+
		tr("established"));
	bt_socket->writeBlock("SS!",3);
	return;
      }
    }
    LogLine(RDConfig::LogInfo,tr("connection to harlond device at ")+
	    bt_ip_address.toString()+QString().sprintf(":%d ",bt_tcp_port)+
	    tr("refused, invalid password"));
  }

  if(cmds[0]=="ON") {
    if(cmds.size()==2) {
      emit gpiChanged(bt_matrix,cmds[1].toInt()-1,true);
    }
  }

  if(cmds[0]=="OF") {
    if(cmds.size()==2) {
      emit gpiChanged(bt_matrix,cmds[1].toInt()-1,false);
    }
  }
}
开发者ID:WMTH,项目名称:rivendell,代码行数:32,代码来源:harlond.cpp


示例5: SigHandler

void SigHandler(int signo)
{
  pid_t pLocalPid;

  switch(signo) {
  case SIGCHLD:
    pLocalPid=waitpid(-1,NULL,WNOHANG);
    while(pLocalPid>0) {
      pLocalPid=waitpid(-1,NULL,WNOHANG);
    }
    ::signal(SIGCHLD,SigHandler);
    ::signal(SIGTERM,SigHandler);
    ::signal(SIGINT,SigHandler);
    return;

  case SIGTERM:
    LogLine(RDConfig::LogInfo,"ripcd exiting normally");
    RDDeletePid(RD_PID_DIR,"ripcd.pid");
    exit(0);
    break;

  case SIGINT:
    LogLine(RDConfig::LogInfo,"ripcd exiting on SIGINT");
    RDDeletePid(RD_PID_DIR,"ripcd.pid");
    exit(0);
    break;
  }
}
开发者ID:stgabmp,项目名称:Rivendell,代码行数:28,代码来源:ripcd.cpp


示例6: QLocalServer

void CIPCServer::LocalListen(const QString& Name)
{
	if(!Name.isEmpty())
	{
		m_Local = new QLocalServer(this);

		if(m_Local->listen(Name))
		{
			m_Name = Name;
			LogLine(LOG_NOTE, tr("Start local server %1").arg(Name));
		}
		else
		{
			LogLine(LOG_WARNING, tr("Failed to start local server name %1, selecting alternative name").arg(Name));

			QString tmpName = QString("%1_%2").arg(Name).arg(GetRand64());
			if(m_Local->listen(tmpName))
			{
				m_Name = tmpName;
				LogLine(LOG_WARNING, tr("Started Local server witn temporary name %1").arg(tmpName));
			}
			else
				LogLine(LOG_ERROR, tr("Failed to start local server!"));
		}

		connect(m_Local, SIGNAL(newConnection()), this, SLOT(OnLocalConnection()));
	}
	else
		m_Local = NULL;
}
开发者ID:bratao,项目名称:NeoLoader,代码行数:30,代码来源:IPCServer.cpp


示例7: QTcpServer

void CIPCServer::RemoteListen(quint16 Port)
{
	if(Port != 0)
	{
		m_Remote = new QTcpServer(this);

		if(m_Remote->listen(QHostAddress::Any, Port)) 
		{
			m_Port = Port;
			LogLine(LOG_NOTE, tr("Start remote server on port %1").arg(Port));
		}
		else
		{
			LogLine(LOG_WARNING, tr("Failed to start remote server on port %1, selecting alternative port").arg(Port));

			quint16 tmpPort = Port + GetRandomInt(1, 1000);
			if(m_Remote->listen(QHostAddress::Any, tmpPort)) 
			{
				m_Port = tmpPort;
				LogLine(LOG_WARNING, tr("Started remote server witn temporary port %1").arg(tmpPort));
			}
			else
				LogLine(LOG_ERROR, tr("Failed to start remote server!"));
		}

		connect(m_Remote, SIGNAL(newConnection()), this, SLOT(OnRemoteConnection()));
	}
	else
		m_Remote = NULL;
}
开发者ID:bratao,项目名称:NeoLoader,代码行数:30,代码来源:IPCServer.cpp


示例8: LogLine

void CKadHandler::HandleNodeReq(const CVariant& NodeReq, CKadNode* pNode, CComChannel* pChannel)
{
	if(GetParent<CKademlia>()->Cfg()->GetBool("DebugRT"))
		LogLine(LOG_DEBUG, L"Recived 'Node Resuest' to %s", pNode->GetID().ToHex().c_str());

	CVariant NodeRes;

	uint32 uDesiredCount = NodeReq["RCT"];
	if(uDesiredCount == 0)
		throw CException(LOG_ERROR, L"node requested 0 nodes");

	int iMaxState = NodeReq.Get("MNC", NODE_2ND_CLASS);

	NodeMap Nodes;
	if(!NodeReq.Has("TID"))
		GetParent<CKademlia>()->Root()->GetBootstrapNodes(GetParent<CKademlia>()->Root()->GetID(), Nodes, uDesiredCount, pChannel->GetAddress().GetProtocol(), iMaxState);
	else
		GetParent<CKademlia>()->Root()->GetClosestNodes(NodeReq["TID"], Nodes, uDesiredCount, pChannel->GetAddress().GetProtocol(), iMaxState);
	
	CVariant List;
	for(NodeMap::iterator I = Nodes.begin(); I != Nodes.end(); I++)
		List.Append(I->second->Store());
	NodeRes["LIST"] = List;

	if(GetParent<CKademlia>()->Cfg()->GetBool("DebugRT"))
		LogLine(LOG_DEBUG, L"Sending 'Node Response' to %s", pNode->GetID().ToHex().c_str());
	pChannel->QueuePacket(KAD_NODE_RESPONSE, NodeRes);
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:28,代码来源:KadHandler.cpp


示例9: TryAssemblyMetadata

bool CTorrent::TryInstallMetadata()
{
    if(m_MetadataExchange && m_MetadataExchange->NewData)
    {
        m_MetadataExchange->NewData = false;

        QByteArray Payload = TryAssemblyMetadata();
        if(!Payload.isEmpty())
        {
            if(!m_TorrentInfo->LoadMetadata(Payload))
            {
                LogLine(LOG_DEBUG | LOG_ERROR, tr("The torrent metadata for %1 (%2) cannot not be parsed.").arg(GetFile()->GetFileName()).arg(QString(m_TorrentInfo->GetInfoHash().toHex())));
                // that is not recoverable!!!!
                GetFile()->GetInspector()->BlackListHash(GetHash()); // Note: This will delete this
                return false;
            }
            else
            {
                LogLine(LOG_DEBUG | LOG_SUCCESS, tr("recived metadata for torrent %1 (%2)").arg(GetFile()->GetFileName()).arg(QString(m_TorrentInfo->GetInfoHash().toHex())));
                if(!GetFile()->IsPending())
                    SaveTorrentToFile();

                if(!InstallMetadata()) // Note: This can delete this
                    return false;

                emit MetadataLoaded();
            }

            delete m_MetadataExchange;
            m_MetadataExchange = NULL;
            return true;
        }
    }
    return true;
}
开发者ID:supertanglang,项目名称:NeoLoader,代码行数:35,代码来源:Torrent.cpp


示例10: UD_ZERO

void CUDTSocketListner::Process()
{
	for(;;) // repeat untill all pending connections are accepted
	{
		/*timeval tv;
		tv.tv_sec = 0;
		tv.tv_usec = 0;
		UDT::UDSET readfds;
		UD_ZERO(&readfds);
		UD_SET(m_Server, &readfds);
		int res	= UDT::select(0, &readfds, NULL, NULL, &tv);
		if (!((res != UDT::ERROR) && (UD_ISSET(m_Server, &readfds))))
			break;*/
		
		sockaddr_in6 sa; // sockaddr_in is smaller
		int sa_len = sizeof(sa); 
		UDTSOCKET Client = UDT::accept(m_Server, (sockaddr*)&sa, &sa_len);
		if (UDT::INVALID_SOCK == Client)
		{
			LogLine(LOG_ERROR, L"accept: %S", UDT::getlasterror().getErrorMessage());
			break;
		}
		else if(Client == NULL)
			break;
		
		ConfigSocket(Client);

		uint64_t SendKey = 0;
		int KeySize = sizeof(SendKey);
		UDT::getsockopt(Client, 0, UDT_SENDKEY, &SendKey, &KeySize);

		CSafeAddress Address((sockaddr*)&sa, sa_len, sa_len == sizeof(sockaddr_in) ? CSafeAddress::eUDT_IP4 : CSafeAddress::eUDT_IP6);
		Address.SetPassKey(SendKey);
		GetParent<CSmartSocket>()->AddSessions(Address, new CUDTSocketSession(this, Client, Address));
	}

	const uint64 Size = 0xFFFF;
	char Buffer[Size];
	for(;;) // repeat untill all data is read
	{
		sockaddr_in6 sa; // sockaddr_in is smaller
		int sa_len = sizeof(sa); 
		uint64_t RecvKey = 0;
		int Recived = UDT::recvfrom(m_Server, Buffer, Size, (sockaddr*)&sa, &sa_len, &RecvKey);
		if (UDT::ERROR == Recived)
		{
			LogLine(LOG_ERROR, L"recvfrom: %S", UDT::getlasterror().getErrorMessage());
			break;
		}
		else if(Recived == 0)
			break; // nothing more to be recived
		CBuffer Packet(Buffer, Recived, true);

		CSafeAddress Address((sockaddr*)&sa, sa_len, sa_len == sizeof(sockaddr_in) ? CSafeAddress::eUDT_IP4 : CSafeAddress::eUDT_IP6);
		Address.SetPassKey(RecvKey);
		ReceiveFrom(Packet, Address);
	}
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:58,代码来源:UDTSocketSession.cpp


示例11: CSocketListner

CUDTSocketListner::CUDTSocketListner(CSmartSocket* pSocket, bool bIPv6, uint16 Port)
 : CSocketListner(pSocket)
{
	if(m_Count++ == 0)
		UDT::startup();

	m_bIPv6 = bIPv6;
	m_Port = 0;

	if(m_bIPv6)
	{
		m_sa = (sockaddr*)new sockaddr_in6;
		memset(m_sa, 0, sizeof(sockaddr_in6));
		((sockaddr_in6*)m_sa)->sin6_family = AF_INET6;
		((sockaddr_in6*)m_sa)->sin6_addr = in6addr_any;
		((sockaddr_in6*)m_sa)->sin6_port = htons((u_short)Port);
	}
	else
	{
		m_sa = (sockaddr*)new sockaddr_in;
		memset(m_sa, 0, sizeof(sockaddr_in));
		((sockaddr_in*)m_sa)->sin_family = AF_INET;
		((sockaddr_in*)m_sa)->sin_addr.s_addr = INADDR_ANY;	
		((sockaddr_in*)m_sa)->sin_port = htons((u_short)Port);
	}

	m_Server = UDT::socket(m_bIPv6 ? AF_INET6 : AF_INET, SOCK_STREAM, IPPROTO_IP);

	if(uint64 RecvKey = pSocket->GetRecvKey())
	{
		UDT::setsockopt(m_Server, 0, UDT_RECVKEY, &RecvKey, sizeof(RecvKey));
		bool Obfuscate = true;
		UDT::setsockopt(m_Server, 0, UDT_OBFUSCATE, &Obfuscate, sizeof(Obfuscate));
	}

	bool DirectUDP = true;
	UDT::setsockopt(m_Server, 0, UDT_DIRECT, &DirectUDP, sizeof(DirectUDP));

	bool reuse_addr = true; // Note: this is true by default anyways
	UDT::setsockopt(m_Server, 0, UDT_REUSEADDR, &reuse_addr, sizeof(reuse_addr));
	if (UDT::ERROR == UDT::bind(m_Server, m_sa, m_bIPv6 ? sizeof(sockaddr_in6) : sizeof(sockaddr_in)))
	{
		LogLine(LOG_ERROR, L"bind: %S", UDT::getlasterror().getErrorMessage());
		return;
	}
	if (UDT::ERROR == UDT::listen(m_Server, 1024))
	{
		LogLine(LOG_ERROR, L"listen: %S", UDT::getlasterror().getErrorMessage());
		return;
	}

	m_Port = Port;
	LogLine(LOG_SUCCESS, L"%s Socket is listening at port %d", m_bIPv6 ? L"UDTv6" : L"UDT", m_Port);

	bool blockng = false;
	UDT::setsockopt(m_Server, 0, UDT_RCVSYN, &blockng, sizeof(blockng));
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:57,代码来源:UDTSocketSession.cpp


示例12: LogLine

void CKadHandler::HandleRouteReq(const CVariant& RouteReq, CKadNode* pNode, CComChannel* pChannel)
{
	if(GetParent<CKademlia>()->Cfg()->GetBool("DebugRU"))
		LogLine(LOG_DEBUG, L"Recived 'Route Resuest' from %s", pNode->GetID().ToHex().c_str());

	CVariant RouteRes(CVariant::EMap);

	SKadData* pData = pChannel->GetData<SKadData>();
	CPointer<CKadRelay> pRelay = pData->pLookup->Cast<CKadRelay>();
	if(!pRelay)
	{
		if(!RouteReq.Has("TID")) // this is optional it is not send on a refresn
			throw CException(LOG_ERROR, L"Invalid Lookup Request");

		if(pData->pLookup)
			throw CException(LOG_ERROR, L"Recived Route Resuest for a lookup that is not a CKadRelay");

		CLookupManager* pLookupManager = GetParent<CKademlia>()->Manager();
		pRelay = pLookupManager->GetRelayEx(RouteReq["EID"], RouteReq["TID"]); // find already existing relay for this Entity and target combination
		//ASSERT(pRelay == pLookupManager->GetLookup(RouteReq["LID"])->Cast<CKadRelay>()); // lookup ID should be consistent

		if(!pRelay)
		{
			pRelay = new CKadRelay(RouteReq["TID"], pLookupManager);
			if(pRelay->InitRelay(RouteReq)) // if false it means the lookup is invalid
			{
				pRelay->SetHopLimit(RouteReq.Get("JMPS"));
				pRelay->SetJumpCount(RouteReq.Get("HOPS"));

				pRelay->SetBrancheCount(RouteReq.Get("BRCH"));

				pRelay->SetLookupID(RouteReq["LID"]);
				pLookupManager->StartLookup(pRelay.Obj());

				if(RouteReq.Has("TRACE"))
					pRelay->EnableTrace();
			}
		}

		// For this cahnnel the relay was new, setup BC
		pData->pLookup = CPointer<CKadLookup>(pRelay, true); // weak pointer
		pChannel->AddUpLimit(pData->pLookup->GetUpLimit());
		pChannel->AddDownLimit(pData->pLookup->GetDownLimit());
	}

	string Error = pRelay->AddDownLink(pNode, pChannel); // add or update
	if(!Error.empty())
		RouteRes["ERR"] = Error;

	if(GetParent<CKademlia>()->Cfg()->GetBool("DebugRU"))
		LogLine(LOG_DEBUG, L"Sending 'Route Response' to %s", pNode->GetID().ToHex().c_str());
	pChannel->QueuePacket(KAD_ROUTE_RESPONSE, RouteRes);
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:53,代码来源:RoutingHandler.cpp


示例13: CVariant

CVariant CKademlia::StartLookup(const CUInt128& TargetID, const CVariant& CodeID, const TCallMap& Execute, const TStoreMap& Store, CPrivateKey* pStoreKey, const TLoadMap& Load
									, int Timeout, int HopLimit, int JumpCount, int SpreadCount, bool bTrace, const wstring& Name)
{
	if(!m_pKadHandler)
		return CVariant();

	if(!CodeID.IsValid() && Store.empty() && Load.empty())
	{
		LogLine(LOG_ERROR, L"Attempted to start an empty Lookup");
		return CVariant();
	}

	CPointer<CKadTask> pLookup = new CKadTask(TargetID, m_pLookupManager);
	pLookup->SetName(Name);

	if(Timeout != -1)
		pLookup->SetTimeOut(Timeout);

	if(HopLimit != -1)
		pLookup->SetHopLimit(HopLimit);
	if(JumpCount != -1)
		pLookup->SetJumpCount(JumpCount);
	if(SpreadCount != -1)
		pLookup->SetSpreadCount(SpreadCount);
	if(bTrace)
		pLookup->EnableTrace();

	if(pStoreKey)
		pLookup->SetStoreKey(pStoreKey);

	for(TStoreMap::const_iterator I = Store.begin(); I != Store.end(); I++)
		pLookup->Store(I->first, I->second.Path, I->second.Data);
	
	for(TLoadMap::const_iterator I = Load.begin(); I != Load.end(); I++)
		pLookup->Load(I->first, I->second.Path);

	if(CodeID.IsValid())
	{
		if(!pLookup->SetupScript(CodeID))
		{
			LogLine(LOG_ERROR, L"Attempted to start a smart lookup with an unavailable script: %s", ToHex(CodeID.GetData(), CodeID.GetSize()).c_str());
			return CVariant();
		}
	
		for(TCallMap::const_iterator I = Execute.begin(); I != Execute.end(); I++)
			pLookup->AddCall(I->second.Function, I->second.Parameters, I->first);
	}

	CVariant LookupID = m_pLookupManager->StartLookup(pLookup.Obj());

	return LookupID;
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:52,代码来源:Kademlia.cpp


示例14: GetName

void CKadScript::LogReport(UINT Flags, const wstring& ErrorMessage, const string& Error)
{
	wstring Operation = L"Kad Script";
	Operation += L" (" + GetName() + L" v" + CKadScript::GetVersion(GetVersion()) + L")";

	if(!Error.empty())
		LogLine(LOG_DEBUG | Flags, L"%s caused an Error: %s", Operation.c_str(), ErrorMessage.c_str());
	else
		LogLine(LOG_DEBUG | Flags, L"%s Reports: %s", Operation.c_str(), ErrorMessage.c_str());

	if(m_pLogger)
		m_pLogger->LogReport(Flags, ErrorMessage, Error);
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:13,代码来源:KadScript.cpp


示例15: ASSERT

bool CTorrent::LoadTorrentFromFile(const QByteArray& InfoHash)
{
    ASSERT(m_TorrentInfo == NULL);
    m_TorrentInfo = new CTorrentInfo(this);

    ASSERT(m_pHash.isNull());
    m_pHash = CFileHashPtr(new CFileHash(HashTorrent));
    m_pHash->SetHash(InfoHash);

    QString TorrentFile = QString(InfoHash.toHex()) + ".torrent";

    if(m_TorrentInfo->LoadTorrentFile(theCore->m_TorrentManager->GetTorrentDir() + TorrentFile))
    {
        if(m_TorrentInfo->GetInfoHash() == InfoHash)
        {
            CFile* pFile = GetFile();

            if(pFile->GetFileSize() == 0)
                pFile->SetFileSize(m_TorrentInfo->GetTotalLength());

            LoadPieceHashes();

            if(m_TorrentInfo->IsMultiFile() && !pFile->IsMultiFile())
            {
                CFileHashPtr pMasterHash = pFile->GetMasterHash();
                if(!pMasterHash.isNull() && pMasterHash->GetHash() == InfoHash)
                {
                    LogLine(LOG_DEBUG | LOG_ERROR, tr("The multi file %1 is missing its proper index, restoring form torrent").arg(pFile->GetFileName()));
                    InstallMetadata();
                }
            }

            if(!m_TorrentInfo->IsEmpty() && !pFile->IsComplete() && !pFile->GetPartMap())
                SetupPartMap();
        }
        else
        {
            LogLine(LOG_DEBUG | LOG_ERROR, tr("The torrent file %1 contains an invalid infohash").arg(TorrentFile));
            delete m_TorrentInfo;
            m_TorrentInfo = new CTorrentInfo(this);
            m_TorrentInfo->SetInfoHash(InfoHash);
        }
    }
    else
        m_TorrentInfo->SetInfoHash(InfoHash);
    theCore->m_TorrentManager->RegisterInfoHash(m_TorrentInfo->GetInfoHash());

    return true; // Note: that is always true even if we fail to load as we always wil be able to proceed one way or another
}
开发者ID:supertanglang,项目名称:NeoLoader,代码行数:49,代码来源:Torrent.cpp


示例16: CPrivateKey

bool CKademlia::LoadData()
{
	m_pKadKey = new CPrivateKey(CAbstractKey::eUndefined);
	wstring ConfigPath = Cfg()->GetString("ConfigPath");
	if(!ConfigPath.empty())
	{
		CVariant Data;
		if(ReadFile(ConfigPath + L"NeoKad.dat", Data))
		{
			try
			{
				const CVariant& Info = Data["INFO"];

				string Version = Info["VER"];

				const CVariant& KeyValue = Info["PK"];
				if(!m_pKadKey->SetKey(KeyValue.GetData(), KeyValue.GetSize()))
					LogLine(LOG_ERROR, L"Loaded Invalid private Key from file");

				/*CBuffer PL = QByteArray("1234567890ABCDEF");
				CBuffer Sig;
				m_pKadKey->Sign(&PL, &Sig);
				Sig.GetSize();*/
			}
			catch(const CException&)
			{
				ASSERT(0);
				return false;
			}
		}
	}
	return true;
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:33,代码来源:Kademlia.cpp


示例17: CPublicKey

CPublicKey* CKadNode::SetIDKey(const CVariant& Info)
{
	const CVariant& KeyValue = Info["PK"];
	CHolder<CPublicKey> pKey = new CPublicKey();	
	if(pKey->SetKey(KeyValue.GetData(), KeyValue.GetSize()))
	{
		UINT eHashFunkt = Info.Has("HK") ? CAbstractKey::Str2Algorithm(Info["HK"]) & CAbstractKey::eHashFunkt : CAbstractKey::eUndefined;
		if(m_ID.SetKey(pKey, eHashFunkt))
			return m_ID.GetKey();
		else
			LogLine(LOG_ERROR, L"Recived wrong Key from Node");
	}
	else
		LogLine(LOG_ERROR, L"Recived Invalid Key from Node");
	return NULL;
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:16,代码来源:KadNode.cpp


示例18: GetProgress

void CKadOperation::ProxyingResponse(CKadNode* pNode, CComChannel* pChannel, const string &Error)
{
	if(m_LookupHistory)
		m_LookupHistory->RegisterResponse(pNode->GetID());

	SOpProgress* pProgress = GetProgress(pNode);
	if(!pProgress)
		return;

	pProgress->uTimeOut = -1;

	if(!Error.empty())
	{
		pProgress->Shares = 0;
		pProgress->OpState = eOpFailed;

		LogLine(LOG_DEBUG, L"Recived error: '%S' on proxy lookup", Error.c_str());
	}
	else
	{
		pProgress->OpState = eOpProxy;

		if(m_pOperator && m_pOperator->IsValid())
			m_pOperator->OnProxyNode(pNode);

		SendRequests(pNode, pChannel, pProgress, false);
	}
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:28,代码来源:KadOperation.cpp


示例19: strcpy

void CmLog::LogWarning(const char* fmt, ...)
{
	char buf[1 << 16];
	strcpy(buf, "Warning: ");
	va_list args;
	va_start( args, fmt );
	vsnprintf(buf + 9, 1<<16, fmt, args );
	LogLine(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY, buf);
}
开发者ID:flyfj,项目名称:Saliency,代码行数:9,代码来源:CmLog.cpp


示例20: LogLine

CHttpServer::CHttpServer(int Port, QObject* qObject)
{
	m_Port = Port;
	if(!Listen(Port))
		LogLine(LOG_ERROR, tr("Failed to listen on http port"));

	m_TransferBufferSize = KB2B(4);
	m_KeepAlive = 115; // seconds
}
开发者ID:bratao,项目名称:NeoLoader,代码行数:9,代码来源:HttpServer.cpp



注:本文中的LogLine函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LogMagickEvent函数代码示例发布时间:2022-05-30
下一篇:
C++ LogLevel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap