1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 23:26:45 +02:00

give file senders their own threads

This commit is contained in:
Jfreegman
2014-06-26 18:20:56 -04:00
parent e8a39e1722
commit da65ba4e8d
5 changed files with 104 additions and 80 deletions

View File

@ -23,16 +23,17 @@
#ifndef _filesenders_h
#define _filesenders_h
#include "toxic.h"
#include "windows.h"
#define FILE_PIECE_SIZE 2048 /* must be >= (MAX_CRYPTO_DATA_SIZE - 2) in toxcore/net_crypto.h */
#define MAX_FILES 256
#define TIMEOUT_FILESENDER 300
typedef struct {
pthread_t tid;
pthread_mutex_t lock;
FILE *file;
ToxWindow *toxwin;
Tox *m;
int32_t friendnum;
bool active;
int filenum;
@ -42,11 +43,12 @@ typedef struct {
uint64_t timestamp;
uint64_t size;
uint32_t line_id;
} FileSender;
} FSenderThread;
void new_filesender_thread(ToxWindow *self, Tox *m, uint8_t *path, int path_len, FILE *file_to_send,
int filenum, uint64_t filesize);
/* Should only be called on exit */
void close_all_file_senders(void);
void do_file_senders(Tox *m);
#endif /* #define _filesenders_h */