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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 return; | 240 return; |
241 } | 241 } |
242 | 242 |
243 LOG(LS_VERBOSE) << "AutoDetectProxy probing type " << TEST_ORDER[next_] | 243 LOG(LS_VERBOSE) << "AutoDetectProxy probing type " << TEST_ORDER[next_] |
244 << " sending " << probe.size() << " bytes"; | 244 << " sending " << probe.size() << " bytes"; |
245 socket_->Send(probe.data(), probe.size()); | 245 socket_->Send(probe.data(), probe.size()); |
246 } | 246 } |
247 | 247 |
248 void AutoDetectProxy::OnReadEvent(AsyncSocket * socket) { | 248 void AutoDetectProxy::OnReadEvent(AsyncSocket * socket) { |
249 char data[257]; | 249 char data[257]; |
250 int len = socket_->Recv(data, 256); | 250 int64_t timestamp; |
| 251 int len = socket_->Recv(data, 256, ×tamp); |
251 if (len > 0) { | 252 if (len > 0) { |
252 data[len] = 0; | 253 data[len] = 0; |
253 LOG(LS_VERBOSE) << "AutoDetectProxy read " << len << " bytes"; | 254 LOG(LS_VERBOSE) << "AutoDetectProxy read " << len << " bytes"; |
254 } | 255 } |
255 | 256 |
256 switch (TEST_ORDER[next_]) { | 257 switch (TEST_ORDER[next_]) { |
257 case PROXY_HTTPS: | 258 case PROXY_HTTPS: |
258 if ((len >= 2) && (data[0] == '\x05')) { | 259 if ((len >= 2) && (data[0] == '\x05')) { |
259 Complete(PROXY_SOCKS5); | 260 Complete(PROXY_SOCKS5); |
260 return; | 261 return; |
(...skipping 18 matching lines...) Expand all Loading... |
279 Next(); | 280 Next(); |
280 } | 281 } |
281 | 282 |
282 void AutoDetectProxy::OnCloseEvent(AsyncSocket * socket, int error) { | 283 void AutoDetectProxy::OnCloseEvent(AsyncSocket * socket, int error) { |
283 LOG(LS_VERBOSE) << "AutoDetectProxy closed with error: " << error; | 284 LOG(LS_VERBOSE) << "AutoDetectProxy closed with error: " << error; |
284 ++next_; | 285 ++next_; |
285 Next(); | 286 Next(); |
286 } | 287 } |
287 | 288 |
288 } // namespace rtc | 289 } // namespace rtc |
OLD | NEW |