summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Zach C2008-08-12 00:31:56 -0700
committerGravatar Matt Colyer2008-08-12 00:31:56 -0700
commit8d5c88acc75871d2ec59793f312dc0fe0c54351f (patch)
tree0e57f34465af448972be39802d001e4fabdf311b
parent2448b82a1844fbe7cf93bf357152d4936d0c9a4a (diff)
downloadlibimobiledevice-8d5c88acc75871d2ec59793f312dc0fe0c54351f.tar.gz
libimobiledevice-8d5c88acc75871d2ec59793f312dc0fe0c54351f.tar.bz2
Fixed seeking, also connections are no longer added twice.
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r--src/main.c2
-rw-r--r--src/usbmux.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 302b886..31c2a76 100644
--- a/src/main.c
+++ b/src/main.c
@@ -124,7 +124,7 @@ int main(int argc, char *argv[]) {
124 printf("Seek & read\n"); 124 printf("Seek & read\n");
125 my_file = afc_open_file(afc, "/readme.libiphone.fx", AFC_FILE_READ); 125 my_file = afc_open_file(afc, "/readme.libiphone.fx", AFC_FILE_READ);
126 bytes = afc_seek_file(afc, my_file, 5); 126 bytes = afc_seek_file(afc, my_file, 5);
127 if (!bytes) printf("WARN: SEEK DID NOT WORK\n"); 127 if (bytes) printf("WARN: SEEK DID NOT WORK\n");
128 char *threeletterword = (char*)malloc(sizeof(char) * 5); 128 char *threeletterword = (char*)malloc(sizeof(char) * 5);
129 bytes = afc_read_file(afc, my_file, threeletterword, 3); 129 bytes = afc_read_file(afc, my_file, threeletterword, 3);
130 threeletterword[3] = '\0'; 130 threeletterword[3] = '\0';
diff --git a/src/usbmux.c b/src/usbmux.c
index 83797dd..d2ef49f 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -129,7 +129,6 @@ usbmux_connection *mux_connect(iPhone *phone, uint16 s_port, uint16 d_port) {
129 new_connection->header->tcp_flags = 0x10; 129 new_connection->header->tcp_flags = 0x10;
130 new_connection->header->scnt = 1; 130 new_connection->header->scnt = 1;
131 new_connection->header->ocnt = 1; 131 new_connection->header->ocnt = 1;
132 add_connection(new_connection);
133 new_connection->phone = phone; 132 new_connection->phone = phone;
134 new_connection->recv_buffer = NULL; 133 new_connection->recv_buffer = NULL;
135 new_connection->r_len = 0; 134 new_connection->r_len = 0;