| 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 <sys/socket.h> | 10 #include <sys/socket.h> |
| 10 #include <sys/uio.h> | 11 #include <sys/uio.h> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 13 #include "base/basictypes.h" | 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 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 int rc = sendmsg(fd, &hdr, 0); | 214 int rc = sendmsg(fd, &hdr, 0); |
| 214 if (rc >= 0) { | 215 if (rc >= 0) { |
| 215 return WriteResult(WRITE_STATUS_OK, rc); | 216 return WriteResult(WRITE_STATUS_OK, rc); |
| 216 } | 217 } |
| 217 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? | 218 return WriteResult((errno == EAGAIN || errno == EWOULDBLOCK) ? |
| 218 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); | 219 WRITE_STATUS_BLOCKED : WRITE_STATUS_ERROR, errno); |
| 219 } | 220 } |
| 220 | 221 |
| 221 } // namespace tools | 222 } // namespace tools |
| 222 } // namespace net | 223 } // namespace net |
| OLD | NEW |