diff options
Diffstat (limited to 'iproxy.c')
| -rw-r--r-- | iproxy.c | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <errno.h> | 31 | #include <errno.h> |
| 32 | #include <arpa/inet.h> | 32 | #include <arpa/inet.h> |
| 33 | #include <pthread.h> | 33 | #include <pthread.h> |
| 34 | #include <usbmuxd.h> | ||
| 35 | #include "sock_stuff.h" | 34 | #include "sock_stuff.h" |
| 36 | #include "libusbmuxd.h" | 35 | #include "libusbmuxd.h" |
| 37 | 36 | ||
| @@ -142,7 +141,7 @@ void *run_ctos_loop(void *arg) | |||
| 142 | void *acceptor_thread(void *arg) | 141 | void *acceptor_thread(void *arg) |
| 143 | { | 142 | { |
| 144 | struct client_data *cdata; | 143 | struct client_data *cdata; |
| 145 | usbmuxd_device_t *dev_list = NULL; | 144 | usbmuxd_scan_result *dev_list = NULL; |
| 146 | pthread_t ctos; | 145 | pthread_t ctos; |
| 147 | 146 | ||
| 148 | if (!arg) { | 147 | if (!arg) { |
| @@ -152,21 +151,21 @@ void *acceptor_thread(void *arg) | |||
| 152 | 151 | ||
| 153 | cdata = (struct client_data*)arg; | 152 | cdata = (struct client_data*)arg; |
| 154 | 153 | ||
| 155 | if (usbmuxd_scan(&dev_list) != 0) { | 154 | if (usbmuxd_scan(&dev_list) < 0) { |
| 156 | printf("Connecting to usbmuxd failed, terminating.\n"); | 155 | printf("Connecting to usbmuxd failed, terminating.\n"); |
| 157 | free(dev_list); | 156 | free(dev_list); |
| 158 | return NULL; | 157 | return NULL; |
| 159 | } | 158 | } |
| 160 | 159 | ||
| 161 | if (!dev_list || dev_list[0].device_id == 0) { | 160 | if (dev_list == NULL || dev_list[0].handle == 0) { |
| 162 | printf("No connected device found, terminating.\n"); | 161 | printf("No connected device found, terminating.\n"); |
| 163 | free(dev_list); | 162 | free(dev_list); |
| 164 | return NULL; | 163 | return NULL; |
| 165 | } | 164 | } |
| 166 | 165 | ||
| 167 | fprintf(stdout, "Requesting connecion to device %d port %d\n", dev_list[0].device_id, device_port); | 166 | fprintf(stdout, "Requesting connecion to device handle == %d, port %d\n", dev_list[0].handle, device_port); |
| 168 | 167 | ||
| 169 | cdata->sfd = usbmuxd_connect(dev_list[0].device_id, device_port); | 168 | cdata->sfd = usbmuxd_connect(dev_list[0].handle, device_port); |
| 170 | free(dev_list); | 169 | free(dev_list); |
| 171 | if (cdata->sfd < 0) { | 170 | if (cdata->sfd < 0) { |
| 172 | fprintf(stderr, "Error connecting to device!\n"); | 171 | fprintf(stderr, "Error connecting to device!\n"); |
| @@ -191,7 +190,7 @@ int main(int argc, char **argv) | |||
| 191 | int mysock = -1; | 190 | int mysock = -1; |
| 192 | 191 | ||
| 193 | if (argc != 3) { | 192 | if (argc != 3) { |
| 194 | printf("usage: %s LOCAL_PORT DEVICE_PORT\n", argv[0]); | 193 | printf("usage: %s LOCAL_TCP_PORT DEVICE_TCP_PORT\n", argv[0]); |
| 195 | return 0; | 194 | return 0; |
| 196 | } | 195 | } |
| 197 | 196 | ||
