diff options
| author | 2009-01-04 22:21:15 +0100 | |
|---|---|---|
| committer | 2009-01-04 22:21:15 +0100 | |
| commit | 5514a3b2a9734d311e4f6014585f922e0b748cab (patch) | |
| tree | ca88a32519d6a07da72d15632de7af04461f7ba8 /src/AFC.c | |
| parent | 4301ef9bb8e9d06ffa4e9172191d58ede5e16f5d (diff) | |
| parent | 5cde55426112a8cb79d809dae5f61e347c007212 (diff) | |
| download | libimobiledevice-5514a3b2a9734d311e4f6014585f922e0b748cab.tar.gz libimobiledevice-5514a3b2a9734d311e4f6014585f922e0b748cab.tar.bz2 | |
Merge branch 'master' into plist
Conflicts:
src/AFC.c
src/lockdown.c
src/lockdown.h
src/plist.c
src/plist.h
Diffstat (limited to 'src/AFC.c')
| -rw-r--r-- | src/AFC.c | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -23,6 +23,7 @@ | |||
| 23 | #include "AFC.h" | 23 | #include "AFC.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | |||
| 26 | // This is the maximum size an AFC data packet can be | 27 | // This is the maximum size an AFC data packet can be |
| 27 | const int MAXIMUM_PACKET_SIZE = (2 << 15) - 32; | 28 | const int MAXIMUM_PACKET_SIZE = (2 << 15) - 32; |
| 28 | 29 | ||
| @@ -555,7 +556,7 @@ iphone_error_t iphone_afc_mkdir(iphone_afc_client_t client, const char *dir) | |||
| 555 | * @return A pointer to an AFCFile struct containing the information received, | 556 | * @return A pointer to an AFCFile struct containing the information received, |
| 556 | * or NULL on failure. | 557 | * or NULL on failure. |
| 557 | */ | 558 | */ |
| 558 | iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path) | 559 | static iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path) |
| 559 | { | 560 | { |
| 560 | char *received, **list; | 561 | char *received, **list; |
| 561 | iphone_afc_file_t my_file; | 562 | iphone_afc_file_t my_file; |
| @@ -794,7 +795,9 @@ iphone_afc_write_file(iphone_afc_client_t client, iphone_afc_file_t file, | |||
| 794 | { | 795 | { |
| 795 | char *acknowledgement = NULL; | 796 | char *acknowledgement = NULL; |
| 796 | const int MAXIMUM_WRITE_SIZE = 1 << 15; | 797 | const int MAXIMUM_WRITE_SIZE = 1 << 15; |
| 797 | uint32_t zero = 0, bytes_loc = 0, segments = (length / MAXIMUM_WRITE_SIZE), current_count = 0, i = 0; | 798 | uint32_t zero = 0, current_count = 0, i = 0; |
| 799 | uint32_t segments = (length / MAXIMUM_WRITE_SIZE); | ||
| 800 | int bytes_loc = 0; | ||
| 798 | char *out_buffer = NULL; | 801 | char *out_buffer = NULL; |
| 799 | 802 | ||
| 800 | if (!client || !client->afc_packet || !client->connection || !file || !bytes) | 803 | if (!client || !client->afc_packet || !client->connection || !file || !bytes) |
| @@ -925,7 +928,8 @@ iphone_error_t iphone_afc_close_file(iphone_afc_client_t client, iphone_afc_file | |||
| 925 | iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_t file, int seekpos) | 928 | iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_t file, int seekpos) |
| 926 | { | 929 | { |
| 927 | char *buffer = (char *) malloc(sizeof(char) * 24); | 930 | char *buffer = (char *) malloc(sizeof(char) * 24); |
| 928 | uint32_t seekto = 0, bytes = 0, zero = 0; | 931 | uint32_t seekto = 0, zero = 0; |
| 932 | int bytes = 0; | ||
| 929 | 933 | ||
| 930 | if (seekpos < 0) | 934 | if (seekpos < 0) |
| 931 | seekpos = file->size - abs(seekpos); | 935 | seekpos = file->size - abs(seekpos); |
| @@ -978,7 +982,8 @@ iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_ | |||
| 978 | iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) | 982 | iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) |
| 979 | { | 983 | { |
| 980 | char *buffer = (char *) malloc(sizeof(char) * 16); | 984 | char *buffer = (char *) malloc(sizeof(char) * 16); |
| 981 | uint32_t bytes = 0, zero = 0; | 985 | int bytes = 0; |
| 986 | uint32_t zero = 0; | ||
| 982 | 987 | ||
| 983 | afc_lock(client); | 988 | afc_lock(client); |
| 984 | 989 | ||
