diff options
| -rw-r--r-- | src/iphone.c | 7 | ||||
| -rw-r--r-- | src/usbmux.c | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/iphone.c b/src/iphone.c index 77b67c3..6833e4c 100644 --- a/src/iphone.c +++ b/src/iphone.c | |||
| @@ -148,6 +148,8 @@ int send_to_phone(iPhone *phone, char *data, int datalen) { | |||
| 148 | bytes = usb_bulk_write(phone->device, BULKOUT, data, datalen, 800); | 148 | bytes = usb_bulk_write(phone->device, BULKOUT, data, datalen, 800); |
| 149 | if (debug) printf("noooo...?\n"); | 149 | if (debug) printf("noooo...?\n"); |
| 150 | if (bytes < datalen) { | 150 | if (bytes < datalen) { |
| 151 | if(debug && bytes < 0) | ||
| 152 | printf("send_to_iphone(): libusb gave me the error: %s\n", usb_strerror()); | ||
| 151 | return -1; | 153 | return -1; |
| 152 | } else { | 154 | } else { |
| 153 | return bytes; | 155 | return bytes; |
| @@ -169,6 +171,11 @@ int recv_from_phone(iPhone *phone, char *data, int datalen) { | |||
| 169 | if (!phone) return -1; | 171 | if (!phone) return -1; |
| 170 | int bytes = 0; | 172 | int bytes = 0; |
| 171 | bytes = usb_bulk_read(phone->device, BULKIN, data, datalen, 3500); | 173 | bytes = usb_bulk_read(phone->device, BULKIN, data, datalen, 3500); |
| 174 | if(bytes < 0) | ||
| 175 | { | ||
| 176 | if(debug) printf("recv_from_iphone(): libusb gave me the error: %s\n", usb_strerror()); | ||
| 177 | return -1; | ||
| 178 | } | ||
| 172 | return bytes; | 179 | return bytes; |
| 173 | } | 180 | } |
| 174 | 181 | ||
diff --git a/src/usbmux.c b/src/usbmux.c index 474b13e..bdeea09 100644 --- a/src/usbmux.c +++ b/src/usbmux.c | |||
| @@ -112,7 +112,12 @@ void mux_close_connection(iPhone *phone, usbmux_tcp_header *connection) { | |||
| 112 | int bytes = 0; | 112 | int bytes = 0; |
| 113 | 113 | ||
| 114 | bytes = usb_bulk_write(phone->device, BULKOUT, (char*)connection, sizeof(*connection), 800); | 114 | bytes = usb_bulk_write(phone->device, BULKOUT, (char*)connection, sizeof(*connection), 800); |
| 115 | if(debug && bytes < 0) | ||
| 116 | printf("mux_close_connection(): when writing, libusb gave me the error: %s\n", usb_strerror()); | ||
| 117 | |||
| 115 | bytes = usb_bulk_read(phone->device, BULKIN, (char*)connection, sizeof(*connection), 800); | 118 | bytes = usb_bulk_read(phone->device, BULKIN, (char*)connection, sizeof(*connection), 800); |
| 119 | if(debug && bytes < 0) | ||
| 120 | printf("get_iPhone(): when reading, libusb gave me the error: %s\n", usb_strerror()); | ||
| 116 | 121 | ||
| 117 | free(connection); | 122 | free(connection); |
| 118 | } | 123 | } |
