diff options
author | aunsane <aunsane@gmail.com> | 2017-12-21 00:02:10 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-12-21 00:02:10 +0300 |
commit | b60db432a3232b0569db7d39c04479efbcc9b73d (patch) | |
tree | bf9179bc32d538092eb029971ff191ecf187e74f | |
parent | b8fc5f5dd8f83d1c3d40a15ec28ac320de21dabd (diff) |
Tox: updated libtox
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/Messenger.c | 10 | ||||
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/net_crypto.c | 4 | ||||
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/util.c | 1 | ||||
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/util.h | 2 | ||||
-rw-r--r-- | protocols/Tox/libtox/src/toxdns/Makefile.inc | 35 | ||||
-rw-r--r-- | protocols/Tox/libtox/src/toxencryptsave/Makefile.inc | 55 |
6 files changed, 10 insertions, 97 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/Messenger.c b/protocols/Tox/libtox/src/toxcore/Messenger.c index 4dd7d0c4a4..e821f53530 100644 --- a/protocols/Tox/libtox/src/toxcore/Messenger.c +++ b/protocols/Tox/libtox/src/toxcore/Messenger.c @@ -375,8 +375,6 @@ static int do_receipts(Messenger *m, int32_t friendnumber, void *userdata) struct Receipts *receipts = m->friendlist[friendnumber].receipts_start; while (receipts) { - struct Receipts *temp_r = receipts->next; - if (friend_received_packet(m, friendnumber, receipts->packet_num) == -1) { break; } @@ -385,9 +383,13 @@ static int do_receipts(Messenger *m, int32_t friendnumber, void *userdata) (*m->read_receipt)(m, friendnumber, receipts->msg_id, userdata); } + struct Receipts *r_next = receipts->next; + free(receipts); - m->friendlist[friendnumber].receipts_start = temp_r; - receipts = temp_r; + + m->friendlist[friendnumber].receipts_start = r_next; + + receipts = r_next; } if (!m->friendlist[friendnumber].receipts_start) { diff --git a/protocols/Tox/libtox/src/toxcore/net_crypto.c b/protocols/Tox/libtox/src/toxcore/net_crypto.c index 37cbab188f..440db94abd 100644 --- a/protocols/Tox/libtox/src/toxcore/net_crypto.c +++ b/protocols/Tox/libtox/src/toxcore/net_crypto.c @@ -2811,12 +2811,12 @@ Net_Crypto *new_net_crypto(Logger *log, DHT *dht, TCP_Proxy_Info *proxy_info) set_packet_tcp_connection_callback(temp->tcp_c, &tcp_data_callback, temp); set_oob_packet_tcp_connection_callback(temp->tcp_c, &tcp_oob_callback, temp); - /*if (create_recursive_mutex(&temp->tcp_mutex) != 0 || + if (create_recursive_mutex(&temp->tcp_mutex) != 0 || pthread_mutex_init(&temp->connections_mutex, NULL) != 0) { kill_tcp_connections(temp->tcp_c); free(temp); return NULL; - }*/ + } temp->dht = dht; diff --git a/protocols/Tox/libtox/src/toxcore/util.c b/protocols/Tox/libtox/src/toxcore/util.c index 5202598518..92bbb68c1f 100644 --- a/protocols/Tox/libtox/src/toxcore/util.c +++ b/protocols/Tox/libtox/src/toxcore/util.c @@ -183,6 +183,7 @@ int create_recursive_mutex(pthread_mutex_t *mutex) return -1; } + /* Create queue mutex */ if (pthread_mutex_init(mutex, &attr) != 0) { pthread_mutexattr_destroy(&attr); return -1; diff --git a/protocols/Tox/libtox/src/toxcore/util.h b/protocols/Tox/libtox/src/toxcore/util.h index 6ef9a75f8c..8777e191d8 100644 --- a/protocols/Tox/libtox/src/toxcore/util.h +++ b/protocols/Tox/libtox/src/toxcore/util.h @@ -59,6 +59,6 @@ int load_state(load_state_callback_func load_state_callback, Logger *log, void * const uint8_t *data, uint32_t length, uint16_t cookie_inner); /* Returns -1 if failed or 0 if success */ -//int create_recursive_mutex(pthread_mutex_t *mutex); +int create_recursive_mutex(pthread_mutex_t *mutex); #endif /* UTIL_H */ diff --git a/protocols/Tox/libtox/src/toxdns/Makefile.inc b/protocols/Tox/libtox/src/toxdns/Makefile.inc deleted file mode 100644 index 5b7c012320..0000000000 --- a/protocols/Tox/libtox/src/toxdns/Makefile.inc +++ /dev/null @@ -1,35 +0,0 @@ -lib_LTLIBRARIES += libtoxdns.la - -libtoxdns_la_include_HEADERS = \ - ../toxdns/toxdns.h - -libtoxdns_la_includedir = $(includedir)/tox - -libtoxdns_la_SOURCES = ../toxdns/toxdns.h \ - ../toxdns/toxdns.c - -libtoxdns_la_CFLAGS = -I$(top_srcdir) \ - -I$(top_srcdir)/toxcore \ - $(LIBSODIUM_CFLAGS) \ - $(NACL_CFLAGS) \ - $(PTHREAD_CFLAGS) - -libtoxdns_la_LDFLAGS = $(LT_LDFLAGS) \ - $(EXTRA_LT_LDFLAGS) \ - $(LIBSODIUM_LDFLAGS) \ - $(NACL_LDFLAGS) \ - $(MATH_LDFLAGS) \ - $(RT_LIBS) \ - $(WINSOCK2_LIBS) - -libtoxdns_la_LIBADD = $(LIBSODIUM_LIBS) \ - $(NACL_OBJECTS) \ - $(NAC_LIBS) \ - $(PTHREAD_LIBS) \ - libtoxcore.la - -if SET_SO_VERSION - -EXTRA_libtoxdns_la_DEPENDENCIES = ../so.version - -endif diff --git a/protocols/Tox/libtox/src/toxencryptsave/Makefile.inc b/protocols/Tox/libtox/src/toxencryptsave/Makefile.inc deleted file mode 100644 index bde026cdaf..0000000000 --- a/protocols/Tox/libtox/src/toxencryptsave/Makefile.inc +++ /dev/null @@ -1,55 +0,0 @@ -lib_LTLIBRARIES += libtoxencryptsave.la - -libtoxencryptsave_la_include_HEADERS = \ - ../toxencryptsave/toxencryptsave.h - -libtoxencryptsave_la_includedir = $(includedir)/tox - -libtoxencryptsave_la_SOURCES = ../toxencryptsave/toxencryptsave.h \ - ../toxencryptsave/toxencryptsave.c \ - ../toxencryptsave/defines.h - - -if WITH_NACL -libtoxencryptsave_la_SOURCES += ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c \ - ../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c -endif - -libtoxencryptsave_la_CFLAGS = -I$(top_srcdir) \ - -I$(top_srcdir)/toxcore \ - $(LIBSODIUM_CFLAGS) \ - $(NACL_CFLAGS) \ - $(PTHREAD_CFLAGS) - -libtoxencryptsave_la_LDFLAGS = $(LT_LDFLAGS) \ - $(EXTRA_LT_LDFLAGS) \ - $(LIBSODIUM_LDFLAGS) \ - $(NACL_LDFLAGS) \ - $(MATH_LDFLAGS) \ - $(RT_LIBS) \ - $(WINSOCK2_LIBS) - -libtoxencryptsave_la_LIBADD = $(LIBSODIUM_LIBS) \ - $(NACL_OBJECTS) \ - $(NAC_LIBS) \ - $(PTHREAD_LIBS) \ - libtoxcore.la - -if SET_SO_VERSION - -EXTRA_libtoxencryptsave_la_DEPENDENCIES = ../so.version - -endif |