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 <netinet/in.h> | 8 #include <netinet/in.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
11 #include <sys/uio.h> | 11 #include <sys/uio.h> |
12 #include <string> | 12 #include <string> |
13 | 13 |
| 14 #include "base/basictypes.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_protocol.h" |
16 | 17 |
17 #ifndef SO_RXQ_OVFL | 18 #ifndef SO_RXQ_OVFL |
18 #define SO_RXQ_OVFL 40 | 19 #define SO_RXQ_OVFL 40 |
19 #endif | 20 #endif |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 namespace tools { | 23 namespace tools { |
23 | 24 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 int rc = sendmsg(fd, &hdr, 0); | 195 int rc = sendmsg(fd, &hdr, 0); |
195 if (rc >= 0) { | 196 if (rc >= 0) { |
196 return WriteResult(WRITE_STATUS_OK, rc); | 197 return WriteResult(WRITE_STATUS_OK, rc); |
197 } | 198 } |
198 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? | 199 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? |
199 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); | 200 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); |
200 } | 201 } |
201 | 202 |
202 } // namespace tools | 203 } // namespace tools |
203 } // namespace net | 204 } // namespace net |
OLD | NEW |