| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 SocketAddress AsyncHttpsProxySocket::GetRemoteAddress() const { | 275 SocketAddress AsyncHttpsProxySocket::GetRemoteAddress() const { |
| 276 return dest_; | 276 return dest_; |
| 277 } | 277 } |
| 278 | 278 |
| 279 int AsyncHttpsProxySocket::Close() { | 279 int AsyncHttpsProxySocket::Close() { |
| 280 headers_.clear(); | 280 headers_.clear(); |
| 281 state_ = PS_ERROR; | 281 state_ = PS_ERROR; |
| 282 dest_.Clear(); | 282 dest_.Clear(); |
| 283 delete context_; | 283 delete context_; |
| 284 context_ = NULL; | 284 context_ = nullptr; |
| 285 return BufferedReadAdapter::Close(); | 285 return BufferedReadAdapter::Close(); |
| 286 } | 286 } |
| 287 | 287 |
| 288 Socket::ConnState AsyncHttpsProxySocket::GetState() const { | 288 Socket::ConnState AsyncHttpsProxySocket::GetState() const { |
| 289 if (state_ < PS_TUNNEL) { | 289 if (state_ < PS_TUNNEL) { |
| 290 return CS_CONNECTING; | 290 return CS_CONNECTING; |
| 291 } else if (state_ == PS_TUNNEL) { | 291 } else if (state_ == PS_TUNNEL) { |
| 292 return CS_CONNECTED; | 292 return CS_CONNECTED; |
| 293 } else { | 293 } else { |
| 294 return CS_CLOSED; | 294 return CS_CLOSED; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 size_t cb, | 882 size_t cb, |
| 883 SocketAddress* paddr, | 883 SocketAddress* paddr, |
| 884 int64_t* timestamp) { | 884 int64_t* timestamp) { |
| 885 int res = AsyncSocketAdapter::RecvFrom(pv, cb, paddr, timestamp); | 885 int res = AsyncSocketAdapter::RecvFrom(pv, cb, paddr, timestamp); |
| 886 if (res > 0) | 886 if (res > 0) |
| 887 LogMultiline(level_, label_.c_str(), true, pv, res, hex_mode_, &lms_); | 887 LogMultiline(level_, label_.c_str(), true, pv, res, hex_mode_, &lms_); |
| 888 return res; | 888 return res; |
| 889 } | 889 } |
| 890 | 890 |
| 891 int LoggingSocketAdapter::Close() { | 891 int LoggingSocketAdapter::Close() { |
| 892 LogMultiline(level_, label_.c_str(), false, NULL, 0, hex_mode_, &lms_); | 892 LogMultiline(level_, label_.c_str(), false, nullptr, 0, hex_mode_, &lms_); |
| 893 LogMultiline(level_, label_.c_str(), true, NULL, 0, hex_mode_, &lms_); | 893 LogMultiline(level_, label_.c_str(), true, nullptr, 0, hex_mode_, &lms_); |
| 894 LOG_V(level_) << label_ << " Closed locally"; | 894 LOG_V(level_) << label_ << " Closed locally"; |
| 895 return socket_->Close(); | 895 return socket_->Close(); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void LoggingSocketAdapter::OnConnectEvent(AsyncSocket * socket) { | 898 void LoggingSocketAdapter::OnConnectEvent(AsyncSocket * socket) { |
| 899 LOG_V(level_) << label_ << " Connected"; | 899 LOG_V(level_) << label_ << " Connected"; |
| 900 AsyncSocketAdapter::OnConnectEvent(socket); | 900 AsyncSocketAdapter::OnConnectEvent(socket); |
| 901 } | 901 } |
| 902 | 902 |
| 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, nullptr, 0, hex_mode_, &lms_); |
| 905 LogMultiline(level_, label_.c_str(), true, NULL, 0, hex_mode_, &lms_); | 905 LogMultiline(level_, label_.c_str(), true, nullptr, 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 |