diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 5 |
1 files changed, 1 insertions, 4 deletions
| @@ -847,23 +847,20 @@ static void *usbmuxd_client_init_thread(void *arg) | |||
| 847 | } | 847 | } |
| 848 | pthread_mutex_unlock(&cur_dev->mutex); | 848 | pthread_mutex_unlock(&cur_dev->mutex); |
| 849 | 849 | ||
| 850 | // wait for the initial handshake (SYN->SYN+ACK->ACKto complete | 850 | // wait for the initial handshake (SYN->SYN+ACK->ACK) to complete) |
| 851 | struct timespec ts; | 851 | struct timespec ts; |
| 852 | ts.tv_sec = 0; | 852 | ts.tv_sec = 0; |
| 853 | ts.tv_nsec = 100000000; | 853 | ts.tv_nsec = 100000000; |
| 854 | 854 | ||
| 855 | i = 0; | 855 | i = 0; |
| 856 | printf("waiting for handshake to complete...\n"); | ||
| 857 | while (i < 10000) { | 856 | while (i < 10000) { |
| 858 | if (usbmux_is_connected(cdata->muxclient)) { | 857 | if (usbmux_is_connected(cdata->muxclient)) { |
| 859 | printf("handshake done\n"); | ||
| 860 | break; | 858 | break; |
| 861 | } | 859 | } |
| 862 | nanosleep(&ts, NULL); | 860 | nanosleep(&ts, NULL); |
| 863 | i+=100; | 861 | i+=100; |
| 864 | } | 862 | } |
| 865 | if (!usbmux_is_connected(cdata->muxclient)) { | 863 | if (!usbmux_is_connected(cdata->muxclient)) { |
| 866 | printf("handshake failed\n"); | ||
| 867 | usbmuxd_send_result(cdata->socket, c_req->header.tag, -ENOTCONN); | 864 | usbmuxd_send_result(cdata->socket, c_req->header.tag, -ENOTCONN); |
| 868 | goto leave; | 865 | goto leave; |
| 869 | } | 866 | } |
