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

Method process_send_command_request

src/Proxy.cpp:649–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647}
648
649void CSocks5StateMachine::process_send_command_request(bool entry)
650{
651 if (entry) {
652 // Prepare the request command buffer
653 m_buffer[0] = SOCKS5_VERSION;
654 switch (m_proxyCommand) {
655 case PROXY_CMD_CONNECT:
656 m_buffer[1] = SOCKS5_CMD_CONNECT;
657 break;
658
659 case PROXY_CMD_BIND:
660 m_buffer[1] = SOCKS5_CMD_BIND;
661 break;
662
663 case PROXY_CMD_UDP_ASSOCIATE:
664 m_buffer[1] = SOCKS5_CMD_UDP_ASSOCIATE;
665 break;
666 }
667 m_buffer[2] = SOCKS5_RSV;
668 m_buffer[3] = SOCKS5_ATYP_IPV4_ADDRESS;
669 PokeUInt32( m_buffer+4, StringIPtoUint32(m_peerAddress->IPAddress()) );
670 RawPokeUInt16( m_buffer+8, ENDIAN_HTONS( m_peerAddress->Service() ) );
671
672 // Send the command packet
673 m_packetLength = 10;
674 ProxyWrite(*m_proxyClientSocket, m_buffer, m_packetLength);
675 }
676}
677
678void CSocks5StateMachine::process_receive_command_reply(bool entry)
679{

Callers

nothing calls this directly

Calls 8

PokeUInt32Function · 0.85
RawPokeUInt16Function · 0.85
EncodeBase64Function · 0.85
IPAddressMethod · 0.80
ServiceMethod · 0.80
LengthMethod · 0.80
StringIPtoUint32Function · 0.70
unicode2charFunction · 0.50

Tested by

no test coverage detected