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 |
8 #include <netinet/in.h> | 15 #include <netinet/in.h> |
| 16 #undef __APPLE_USE_RFC_3542 |
9 #include <sys/socket.h> | 17 #include <sys/socket.h> |
10 #include <sys/uio.h> | 18 #include <sys/uio.h> |
11 #include <string> | 19 #include <string> |
12 | 20 |
13 #include "base/basictypes.h" | 21 #include "base/basictypes.h" |
14 #include "base/logging.h" | 22 #include "base/logging.h" |
15 #include "net/quic/quic_protocol.h" | 23 #include "net/quic/quic_protocol.h" |
16 | 24 |
17 #ifndef SO_RXQ_OVFL | 25 #ifndef SO_RXQ_OVFL |
18 #define SO_RXQ_OVFL 40 | 26 #define SO_RXQ_OVFL 40 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 int rc = sendmsg(fd, &hdr, 0); | 245 int rc = sendmsg(fd, &hdr, 0); |
238 if (rc >= 0) { | 246 if (rc >= 0) { |
239 return WriteResult(WRITE_STATUS_OK, rc); | 247 return WriteResult(WRITE_STATUS_OK, rc); |
240 } | 248 } |
241 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? | 249 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? |
242 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); | 250 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); |
243 } | 251 } |
244 | 252 |
245 } // namespace tools | 253 } // namespace tools |
246 } // namespace net | 254 } // namespace net |
OLD | NEW |