diff options
-rw-r--r-- | common/socket.c | 2 | ||||
-rw-r--r-- | tools/idevicedebugserverproxy.c | 11 |
2 files changed, 2 insertions, 11 deletions
diff --git a/common/socket.c b/common/socket.c index 354e6a4..99a96b1 100644 --- a/common/socket.c +++ b/common/socket.c | |||
@@ -1084,8 +1084,6 @@ int socket_check_fd(int fd, fd_mode fdm, unsigned int timeout) | |||
1084 | return -1; | 1084 | return -1; |
1085 | } | 1085 | } |
1086 | } else if (sret == 0) { | 1086 | } else if (sret == 0) { |
1087 | if (verbose >= 2) | ||
1088 | fprintf(stderr, "%s: timeout\n", __func__); | ||
1089 | return -ETIMEDOUT; | 1087 | return -ETIMEDOUT; |
1090 | } | 1088 | } |
1091 | } while (eagain); | 1089 | } while (eagain); |
diff --git a/tools/idevicedebugserverproxy.c b/tools/idevicedebugserverproxy.c index 405a5a4..15e8deb 100644 --- a/tools/idevicedebugserverproxy.c +++ b/tools/idevicedebugserverproxy.c | |||
@@ -121,15 +121,8 @@ static void* connection_handler(void* data) | |||
121 | int dtimeout = 1; | 121 | int dtimeout = 1; |
122 | 122 | ||
123 | while (!quit_flag) { | 123 | while (!quit_flag) { |
124 | fd_set read_fds = fds; | 124 | ssize_t n = socket_receive_timeout(client_fd, buf, bufsize, 0, 1); |
125 | struct timeval tv = { 0, 1000 }; | 125 | if (n != -ETIMEDOUT) { |
126 | int ret_sel = select(client_fd+1, &read_fds, NULL, NULL, &tv); | ||
127 | if (ret_sel < 0) { | ||
128 | perror("select"); | ||
129 | break; | ||
130 | } | ||
131 | if (FD_ISSET(client_fd, &read_fds)) { | ||
132 | ssize_t n = socket_receive(client_fd, buf, bufsize); | ||
133 | if (n < 0) { | 126 | if (n < 0) { |
134 | fprintf(stderr, "Failed to read from client fd: %s\n", strerror(-n)); | 127 | fprintf(stderr, "Failed to read from client fd: %s\n", strerror(-n)); |
135 | break; | 128 | break; |