mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed Tox sync.
This commit is contained in:
parent
d87c772a7e
commit
ec25f64407
|
@ -46,7 +46,7 @@ typedef struct {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
uint16_t friendnum;
|
uint16_t friendnum;
|
||||||
uint8_t filenumber;
|
uint8_t filenumber;
|
||||||
uint8_t nextpiece[1024];
|
uint8_t nextpiece[1400];
|
||||||
uint16_t piecelength;
|
uint16_t piecelength;
|
||||||
} File_t;
|
} File_t;
|
||||||
File_t file_senders[NUM_FILE_SENDERS];
|
File_t file_senders[NUM_FILE_SENDERS];
|
||||||
|
@ -62,8 +62,8 @@ void send_filesenders(Tox *m)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!tox_file_send_data(m, file_senders[i].friendnum, file_senders[i].filenumber, file_senders[i].nextpiece,
|
if (tox_file_send_data(m, file_senders[i].friendnum, file_senders[i].filenumber, file_senders[i].nextpiece,
|
||||||
file_senders[i].piecelength))
|
file_senders[i].piecelength) != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
file_senders[i].piecelength = fread(file_senders[i].nextpiece, 1, tox_file_data_size(m, file_senders[i].friendnum),
|
file_senders[i].piecelength = fread(file_senders[i].nextpiece, 1, tox_file_data_size(m, file_senders[i].friendnum),
|
||||||
|
@ -160,7 +160,7 @@ void file_request_accept(Tox *m, int friendnumber, uint8_t filenumber, uint64_t
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tox_file_send_control(m, friendnumber, 1, filenumber, TOX_FILECONTROL_ACCEPT, 0, 0)) {
|
if (tox_file_send_control(m, friendnumber, 1, filenumber, TOX_FILECONTROL_ACCEPT, 0, 0) == 0) {
|
||||||
printf("Accepted file transfer. (file: %s)\n", fullpath);
|
printf("Accepted file transfer. (file: %s)\n", fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user