summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorRobin Linden <dev@robinlinden.eu>2020-04-13 22:37:31 +0200
committerRobin Linden <dev@robinlinden.eu>2020-04-13 22:43:51 +0200
commit7f9f8045cd6f8d92559cdc9f7d297cf92e960e49 (patch)
treeb933b84586350a6e070a6d8a135690d70e36ddef /toxcore
parentb816c6f8e3ced0f65f3f749e9e6ecb0edd313628 (diff)
Fix things not being initialized if creating a TCP-only network
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/network.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toxcore/network.c b/toxcore/network.c
index 3f297ad7..e5a58331 100644
--- a/toxcore/network.c
+++ b/toxcore/network.c
@@ -956,6 +956,10 @@ Networking_Core *new_networking_ex(const Logger *log, IP ip, uint16_t port_from,
956 956
957Networking_Core *new_networking_no_udp(const Logger *log) 957Networking_Core *new_networking_no_udp(const Logger *log)
958{ 958{
959 if (networking_at_startup() != 0) {
960 return nullptr;
961 }
962
959 /* this is the easiest way to completely disable UDP without changing too much code. */ 963 /* this is the easiest way to completely disable UDP without changing too much code. */
960 Networking_Core *net = (Networking_Core *)calloc(1, sizeof(Networking_Core)); 964 Networking_Core *net = (Networking_Core *)calloc(1, sizeof(Networking_Core));
961 965