| 625 | |
| 626 | |
| 627 | bool CServerSocket::PacketReceived(CPacket* packet) |
| 628 | { |
| 629 | AddDebugLogLineN(logServer, CFormat("Server: Packet Received: Prot %x, Opcode %x, Length %u") % packet->GetProtocol() % packet->GetOpCode() % packet->GetPacketSize()); |
| 630 | |
| 631 | if (packet->GetProtocol() == OP_PACKEDPROT) { |
| 632 | if (!packet->UnPackPacket(250000)){ |
| 633 | AddDebugLogLineN(logZLib, CFormat("Failed to decompress server TCP packet: protocol=0x%02x opcode=0x%02x size=%u") |
| 634 | % packet->GetProtocol() % packet->GetOpCode() % packet->GetPacketSize()); |
| 635 | theStats::AddDownOverheadServer(packet->GetPacketSize()); |
| 636 | return true; |
| 637 | } |
| 638 | |
| 639 | packet->SetProtocol(OP_EDONKEYPROT); |
| 640 | } |
| 641 | |
| 642 | if (packet->GetProtocol() == OP_EDONKEYPROT) { |
| 643 | ProcessPacket(packet->GetDataBuffer(), packet->GetPacketSize(), packet->GetOpCode()); |
| 644 | } else { |
| 645 | AddDebugLogLineN(logServer, CFormat("Received server TCP packet with unknown protocol: protocol=0x%02x opcode=0x%02x size=%u") |
| 646 | % packet->GetProtocol() % packet->GetOpCode() % packet->GetPacketSize()); |
| 647 | theStats::AddDownOverheadServer(packet->GetPacketSize()); |
| 648 | } |
| 649 | |
| 650 | return true; |
| 651 | } |
| 652 | |
| 653 | |
| 654 | void CServerSocket::OnClose(int WXUNUSED(nErrorCode)) |
nothing calls this directly
no test coverage detected