Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: webrtc/base/autodetectproxy.cc

Issue 1944683002: Read recv timestamps from socket (posix only). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable ipv6 test on Linux due to bot issues. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 int len = socket_->Recv(data, 256, nullptr);
251 if (len > 0) { 251 if (len > 0) {
252 data[len] = 0; 252 data[len] = 0;
253 LOG(LS_VERBOSE) << "AutoDetectProxy read " << len << " bytes"; 253 LOG(LS_VERBOSE) << "AutoDetectProxy read " << len << " bytes";
254 } 254 }
255 255
256 switch (TEST_ORDER[next_]) { 256 switch (TEST_ORDER[next_]) {
257 case PROXY_HTTPS: 257 case PROXY_HTTPS:
258 if ((len >= 2) && (data[0] == '\x05')) { 258 if ((len >= 2) && (data[0] == '\x05')) {
259 Complete(PROXY_SOCKS5); 259 Complete(PROXY_SOCKS5);
260 return; 260 return;
(...skipping 18 matching lines...) Expand all
279 Next(); 279 Next();
280 } 280 }
281 281
282 void AutoDetectProxy::OnCloseEvent(AsyncSocket * socket, int error) { 282 void AutoDetectProxy::OnCloseEvent(AsyncSocket * socket, int error) {
283 LOG(LS_VERBOSE) << "AutoDetectProxy closed with error: " << error; 283 LOG(LS_VERBOSE) << "AutoDetectProxy closed with error: " << error;
284 ++next_; 284 ++next_;
285 Next(); 285 Next();
286 } 286 }
287 287
288 } // namespace rtc 288 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698