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

Method ProcessMuleInfoPacket

src/BaseClient.cpp:840–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840bool CUpDownClient::ProcessMuleInfoPacket(const uint8_t* pachPacket, uint32 nSize)
841{
842 uint8 protocol_version;
843
844 const CMemFile data(pachPacket,nSize);
845
846 // The version number part of this packet will soon be useless since
847 // it is only able to go to v.99. Why the version is a uint8 and why
848 // it was not done as a tag like the eDonkey hello packet is not known.
849 // Therefore, sooner or later, we are going to have to switch over to
850 // using the eDonkey hello packet to set the version. No sense making
851 // a third value sent for versions.
852 uint8 mule_version = data.ReadUInt8();
853 protocol_version = data.ReadUInt8();
854 uint32 tagcount = data.ReadUInt32();
855 if (protocol_version == 0xFF) {
856 // OS Info supporting clients sending a recycled Mule info packet
857 for (uint32 i = 0;i < tagcount; i++){
858 CTag temptag(data, true);
859 switch(temptag.GetNameID()){
860 case ET_OS_INFO:
861 // Special tag, only supporting clients (aMule/Hydranode)
862 // It was recycled from a mod's tag, so if the other side
863 // is not supporting OS Info, we're seriously fucked up :)
864 m_sClientOSInfo = temptag.GetStr();
865
866 // If we didn't send our OSInfo to this client, just send it
867 if (!m_OSInfo_sent) {
868 SendMuleInfoPacket(false,true);
869 }
870
871 UpdateStats();
872
873 break;
874
875 // Your ad... er... I mean TAG, here
876
877 default:
878 break;
879 }
880 }
881 } else {
882 // Old eMule sending tags
883 m_byCompatibleClient = 0;
884 m_byEmuleVersion = mule_version;
885
886 if( m_byEmuleVersion == 0x2B ) {
887 m_byEmuleVersion = 0x22;
888 }
889
890 if (!(m_bEmuleProtocol = (protocol_version == EMULE_PROTOCOL))) {
891 return false;
892 }
893
894 for (uint32 i = 0;i < tagcount; i++){
895 CTag temptag(data, false);
896 switch(temptag.GetNameID()){
897 case ET_COMPRESSION:

Callers 1

ProcessExtPacketMethod · 0.80

Calls 8

CFormatClass · 0.85
ReadUInt8Method · 0.80
ReadUInt32Method · 0.80
GetNameIDMethod · 0.80
IsStrMethod · 0.80
GetFullInfoMethod · 0.80
GetIntMethod · 0.45
IsIntMethod · 0.45

Tested by

no test coverage detected