1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 20:16:44 +02:00

put file senders in one thread due to weird issues & a few fixes

This commit is contained in:
Jfreegman
2014-06-28 12:14:43 -04:00
parent 134e5873a9
commit 33e98fd720
6 changed files with 118 additions and 128 deletions

View File

@ -23,17 +23,16 @@
#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 120
typedef struct {
pthread_t tid;
pthread_mutex_t lock;
FILE *file;
ToxWindow *toxwin;
Tox *m;
int32_t friendnum;
bool active;
int filenum;
@ -43,12 +42,11 @@ typedef struct {
uint64_t timestamp;
uint64_t size;
uint32_t line_id;
} FSenderThread;
void new_filesender_thread(ToxWindow *self, Tox *m, uint8_t *path, int path_len, FILE *file_to_send,
int filenum, uint64_t filesize);
} FileSender;
/* Should only be called on exit */
void close_all_file_senders(void);
void do_file_senders(Tox *m);
#endif /* #define _filesenders_h */