Chromium Code Reviews| 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 // Apple's "in6.h" header file says: | |
| 9 // * RFC 3542 define[s] the following socket options in a manner incompatible | |
| 10 // * with RFC 2292: | |
| 11 // * IPV6_PKTINFO | |
| 12 // and in order to get IPV6_PKTINFO defined at all, | |
| 13 // you must pick a mode, as follows: | |
| 14 #define __APPLE_USE_RFC_3542 | |
|
Ryan Hamilton
2015/03/12 03:34:38
Should this be wrapped in an #if apple_or_darwin_o
dougk
2015/03/12 12:39:10
Personally I find it less ugly not to add preamble
Ryan Hamilton
2015/03/12 17:55:41
I'm happy with adding a #undef but leaving off an
| |
| 8 #include <netinet/in.h> | 15 #include <netinet/in.h> |
| 9 #include <sys/socket.h> | 16 #include <sys/socket.h> |
| 10 #include <sys/uio.h> | 17 #include <sys/uio.h> |
| 11 #include <string> | 18 #include <string> |
| 12 | 19 |
| 13 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
| 14 #include "base/logging.h" | 21 #include "base/logging.h" |
| 15 #include "net/quic/quic_protocol.h" | 22 #include "net/quic/quic_protocol.h" |
| 16 | 23 |
| 17 #ifndef SO_RXQ_OVFL | 24 #ifndef SO_RXQ_OVFL |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 int rc = sendmsg(fd, &hdr, 0); | 246 int rc = sendmsg(fd, &hdr, 0); |
| 240 if (rc >= 0) { | 247 if (rc >= 0) { |
| 241 return WriteResult(WRITE_STATUS_OK, rc); | 248 return WriteResult(WRITE_STATUS_OK, rc); |
| 242 } | 249 } |
| 243 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? | 250 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? |
| 244 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); | 251 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); |
| 245 } | 252 } |
| 246 | 253 |
| 247 } // namespace tools | 254 } // namespace tools |
| 248 } // namespace net | 255 } // namespace net |
| OLD | NEW |