OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 delete [] sensitive; | 681 delete [] sensitive; |
682 DirectSend(request.Data(), request.Length()); | 682 DirectSend(request.Data(), request.Length()); |
683 state_ = SS_AUTH; | 683 state_ = SS_AUTH; |
684 } | 684 } |
685 | 685 |
686 void AsyncSocksProxySocket::SendConnect() { | 686 void AsyncSocksProxySocket::SendConnect() { |
687 ByteBuffer request; | 687 ByteBuffer request; |
688 request.WriteUInt8(5); // Socks Version | 688 request.WriteUInt8(5); // Socks Version |
689 request.WriteUInt8(1); // CONNECT | 689 request.WriteUInt8(1); // CONNECT |
690 request.WriteUInt8(0); // Reserved | 690 request.WriteUInt8(0); // Reserved |
691 if (dest_.IsUnresolved()) { | 691 if (dest_.IsUnresolvedIP()) { |
692 std::string hostname = dest_.hostname(); | 692 std::string hostname = dest_.hostname(); |
693 request.WriteUInt8(3); // DOMAINNAME | 693 request.WriteUInt8(3); // DOMAINNAME |
694 request.WriteUInt8(static_cast<uint8_t>(hostname.size())); | 694 request.WriteUInt8(static_cast<uint8_t>(hostname.size())); |
695 request.WriteString(hostname); // Destination Hostname | 695 request.WriteString(hostname); // Destination Hostname |
696 } else { | 696 } else { |
697 request.WriteUInt8(1); // IPV4 | 697 request.WriteUInt8(1); // IPV4 |
698 request.WriteUInt32(dest_.ip()); // Destination IP | 698 request.WriteUInt32(dest_.ip()); // Destination IP |
699 } | 699 } |
700 request.WriteUInt16(dest_.port()); // Destination Port | 700 request.WriteUInt16(dest_.port()); // Destination Port |
701 DirectSend(request.Data(), request.Length()); | 701 DirectSend(request.Data(), request.Length()); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 void LoggingSocketAdapter::OnCloseEvent(AsyncSocket * socket, int err) { | 903 void LoggingSocketAdapter::OnCloseEvent(AsyncSocket * socket, int err) { |
904 LogMultiline(level_, label_.c_str(), false, NULL, 0, hex_mode_, &lms_); | 904 LogMultiline(level_, label_.c_str(), false, NULL, 0, hex_mode_, &lms_); |
905 LogMultiline(level_, label_.c_str(), true, NULL, 0, hex_mode_, &lms_); | 905 LogMultiline(level_, label_.c_str(), true, NULL, 0, hex_mode_, &lms_); |
906 LOG_V(level_) << label_ << " Closed with error: " << err; | 906 LOG_V(level_) << label_ << " Closed with error: " << err; |
907 AsyncSocketAdapter::OnCloseEvent(socket, err); | 907 AsyncSocketAdapter::OnCloseEvent(socket, err); |
908 } | 908 } |
909 | 909 |
910 /////////////////////////////////////////////////////////////////////////////// | 910 /////////////////////////////////////////////////////////////////////////////// |
911 | 911 |
912 } // namespace rtc | 912 } // namespace rtc |
OLD | NEW |