| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/tools/quic/quic_socket_utils.h" | 5 #include "net/tools/quic/quic_socket_utils.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/net_tstamp.h> | 8 #include <linux/net_tstamp.h> |
| 9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (!SetSendBufferSize(fd, kDefaultSocketReceiveBuffer)) { | 284 if (!SetSendBufferSize(fd, kDefaultSocketReceiveBuffer)) { |
| 285 return -1; | 285 return -1; |
| 286 } | 286 } |
| 287 | 287 |
| 288 rc = SetGetAddressInfo(fd, address_family); | 288 rc = SetGetAddressInfo(fd, address_family); |
| 289 if (rc < 0) { | 289 if (rc < 0) { |
| 290 LOG(ERROR) << "IP detection not supported" << strerror(errno); | 290 LOG(ERROR) << "IP detection not supported" << strerror(errno); |
| 291 return -1; | 291 return -1; |
| 292 } | 292 } |
| 293 | 293 |
| 294 if (FLAGS_quic_use_socket_timestamp) { | 294 rc = SetGetSoftwareReceiveTimestamp(fd); |
| 295 rc = SetGetSoftwareReceiveTimestamp(fd); | 295 if (rc < 0) { |
| 296 if (rc < 0) { | 296 LOG(WARNING) << "SO_TIMESTAMPING not supported; using fallback: " |
| 297 LOG(WARNING) << "SO_TIMESTAMPING not supported; using fallback: " | 297 << strerror(errno); |
| 298 << strerror(errno); | |
| 299 } | |
| 300 } | 298 } |
| 301 | 299 |
| 302 return fd; | 300 return fd; |
| 303 } | 301 } |
| 304 | 302 |
| 305 } // namespace net | 303 } // namespace net |
| OLD | NEW |