mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix things not being initialized if creating a TCP-only network
This commit is contained in:
parent
b816c6f8e3
commit
7f9f8045cd
|
@ -425,8 +425,7 @@ auto_test(send_message)
|
||||||
auto_test(set_name)
|
auto_test(set_name)
|
||||||
auto_test(set_status_message)
|
auto_test(set_status_message)
|
||||||
auto_test(skeleton)
|
auto_test(skeleton)
|
||||||
# TODO(iphydf): Fix this test and re-enable.
|
auto_test(tcp_relay)
|
||||||
#auto_test(tcp_relay)
|
|
||||||
auto_test(tox_many)
|
auto_test(tox_many)
|
||||||
auto_test(tox_many_tcp)
|
auto_test(tox_many_tcp)
|
||||||
auto_test(tox_one)
|
auto_test(tox_one)
|
||||||
|
|
|
@ -24,7 +24,12 @@ int main(void)
|
||||||
tox_options_free(opts);
|
tox_options_free(opts);
|
||||||
|
|
||||||
tox_bootstrap(tox_tcp, "tox.initramfs.io", 33445, key, nullptr);
|
tox_bootstrap(tox_tcp, "tox.initramfs.io", 33445, key, nullptr);
|
||||||
tox_add_tcp_relay(tox_tcp, "tox.initramfs.io", 33445, key, nullptr);
|
|
||||||
|
Tox_Err_Bootstrap tcp_err;
|
||||||
|
tox_add_tcp_relay(tox_tcp, "tox.initramfs.io", 33445, key, &tcp_err);
|
||||||
|
ck_assert_msg(tcp_err == TOX_ERR_BOOTSTRAP_OK,
|
||||||
|
"attempting to add tcp relay returned with an error: %d",
|
||||||
|
tcp_err);
|
||||||
|
|
||||||
printf("Waiting for connection");
|
printf("Waiting for connection");
|
||||||
|
|
||||||
|
|
|
@ -956,6 +956,10 @@ Networking_Core *new_networking_ex(const Logger *log, IP ip, uint16_t port_from,
|
||||||
|
|
||||||
Networking_Core *new_networking_no_udp(const Logger *log)
|
Networking_Core *new_networking_no_udp(const Logger *log)
|
||||||
{
|
{
|
||||||
|
if (networking_at_startup() != 0) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* this is the easiest way to completely disable UDP without changing too much code. */
|
/* this is the easiest way to completely disable UDP without changing too much code. */
|
||||||
Networking_Core *net = (Networking_Core *)calloc(1, sizeof(Networking_Core));
|
Networking_Core *net = (Networking_Core *)calloc(1, sizeof(Networking_Core));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user