MCPcopy Create free account
hub / github.com/amule-project/amule / Get_EC_Response_GetClientQueue

Function Get_EC_Response_GetClientQueue

src/ExternalConn.cpp:1003–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001}
1002
1003static CECPacket *Get_EC_Response_GetClientQueue(const CECPacket *request, CObjTagMap &tagmap, int op)
1004{
1005 CECPacket *response = new CECPacket(op);
1006
1007 EC_DETAIL_LEVEL detail_level = request->GetDetailLevel();
1008
1009 //
1010 // request can contain list of queried items
1011 // (not for incremental update of course)
1012 CTagSet<uint32, EC_TAG_CLIENT> queryitems(request);
1013
1014 const CClientRefList& clients = theApp->uploadqueue->GetUploadingList();
1015 CClientRefList::const_iterator it = clients.begin();
1016 for (; it != clients.end(); ++it) {
1017 CUpDownClient* cur_client = it->GetClient();
1018
1019 if (!cur_client) { // shouldn't happen
1020 continue;
1021 }
1022 if (!queryitems.empty() && !queryitems.count(cur_client->ECID())) {
1023 continue;
1024 }
1025 CValueMap *valuemap = NULL;
1026 if (detail_level == EC_DETAIL_INC_UPDATE) {
1027 valuemap = &tagmap.GetValueMap(cur_client->ECID());
1028 }
1029 CEC_UpDownClient_Tag cli_tag(cur_client, detail_level, valuemap);
1030
1031 response->AddTag(cli_tag);
1032 }
1033
1034 return response;
1035}
1036
1037
1038static CECPacket *Get_EC_Response_GetDownloadQueue(const CECPacket *request, CFileEncoderMap &encoders,

Callers 1

ProcessRequest2Method · 0.85

Calls 7

GetDetailLevelMethod · 0.80
ECIDMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetClientMethod · 0.45
emptyMethod · 0.45
AddTagMethod · 0.45

Tested by

no test coverage detected