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

Method ProcessSharedFileList

src/SearchList.cpp:503–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501
502
503void CSearchList::ProcessSharedFileList(const uint8_t* in_packet, uint32 size,
504 CUpDownClient* sender, bool *moreResultsAvailable, const wxString& directory)
505{
506 wxCHECK_RET(sender, "No sender in search-results from client.");
507
508 wxUIntPtr searchID = reinterpret_cast<wxUIntPtr>(sender);
509
510#ifndef AMULE_DAEMON
511 if (!theApp->amuledlg->m_searchwnd->CheckTabNameExists(sender->GetUserName())) {
512 theApp->amuledlg->m_searchwnd->CreateNewTab(sender->GetUserName() + " (0)", searchID);
513 }
514#endif
515
516 const CMemFile packet(in_packet, size);
517 uint32 results = packet.ReadUInt32();
518 bool unicoded = (sender->GetUnicodeSupport() != utf8strNone);
519 for (unsigned int i = 0; i != results; ++i){
520 CSearchFile* toadd = new CSearchFile(packet, unicoded, searchID, 0, 0, directory);
521 toadd->SetClientID(sender->GetUserIDHybrid());
522 toadd->SetClientPort(sender->GetUserPort());
523 AddToList(toadd, true);
524 }
525
526 if (moreResultsAvailable)
527 *moreResultsAvailable = false;
528
529 int iAddData = (int)(packet.GetLength() - packet.GetPosition());
530 if (iAddData == 1) {
531 uint8 ucMore = packet.ReadUInt8();
532 if (ucMore == 0x00 || ucMore == 0x01){
533 if (moreResultsAvailable) {
534 *moreResultsAvailable = (ucMore == 1);
535 }
536 }
537 }
538}
539
540
541void CSearchList::ProcessSearchAnswer(const uint8_t* in_packet, uint32_t size, bool optUTF8, uint32_t serverIP, uint16_t serverPort)

Callers

nothing calls this directly

Calls 11

CheckTabNameExistsMethod · 0.80
CreateNewTabMethod · 0.80
ReadUInt32Method · 0.80
SetClientPortMethod · 0.80
ReadUInt8Method · 0.80
GetUnicodeSupportMethod · 0.45
SetClientIDMethod · 0.45
GetUserIDHybridMethod · 0.45
GetUserPortMethod · 0.45
GetLengthMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected