| 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 <arpa/inet.h> | 5 #include <arpa/inet.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| 11 #include <string.h> | 11 #include <string.h> |
| 12 #include <sys/socket.h> | 12 #include <sys/socket.h> |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 #include <unistd.h> | 14 #include <unistd.h> |
| 15 | 15 |
| 16 #include <string> | 16 #include <string> |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 20 #include "base/eintr_wrapper.h" | |
| 21 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/posix/eintr_wrapper.h" |
| 22 #include "base/safe_strerror_posix.h" | 22 #include "base/safe_strerror_posix.h" |
| 23 #include "net/base/big_endian.h" | 23 #include "net/base/big_endian.h" |
| 24 #include "net/base/net_util.h" | 24 #include "net/base/net_util.h" |
| 25 #include "net/dns/dns_protocol.h" | 25 #include "net/dns/dns_protocol.h" |
| 26 #include "tools/android/common/daemon.h" | 26 #include "tools/android/common/daemon.h" |
| 27 #include "tools/android/common/net.h" | 27 #include "tools/android/common/net.h" |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Mininum request size: 1 question containing 1 QNAME, 1 TYPE and 1 CLASS. | 31 // Mininum request size: 1 question containing 1 QNAME, 1 TYPE and 1 CLASS. |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 LOG(ERROR) << "Failed to receive a request: " << strerror(errno); | 229 LOG(ERROR) << "Failed to receive a request: " << strerror(errno); |
| 230 CloseFileDescriptor(sock); | 230 CloseFileDescriptor(sock); |
| 231 return 1; | 231 return 1; |
| 232 } | 232 } |
| 233 | 233 |
| 234 if (size > 0) | 234 if (size > 0) |
| 235 HandleRequest(sock, request, size, client_addr); | 235 HandleRequest(sock, request, size, client_addr); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| OLD | NEW |