summaryrefslogtreecommitdiff
path: root/toxcore/onion_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r--toxcore/onion_client.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index 6ef22314..d324dbf2 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -1,25 +1,27 @@
1/* 1/*
2* onion_client.c -- Implementation of the client part of docs/Prevent_Tracking.txt 2 * Implementation of the client part of docs/Prevent_Tracking.txt (The part that
3* (The part that uses the onion stuff to connect to the friend) 3 * uses the onion stuff to connect to the friend)
4* 4 */
5* Copyright (C) 2013 Tox project All Rights Reserved. 5
6* 6/*
7* This file is part of Tox. 7 * Copyright © 2016-2017 The TokTok team.
8* 8 * Copyright © 2013 Tox project.
9* Tox is free software: you can redistribute it and/or modify 9 *
10* it under the terms of the GNU General Public License as published by 10 * This file is part of Tox, the free peer to peer instant messenger.
11* the Free Software Foundation, either version 3 of the License, or 11 *
12* (at your option) any later version. 12 * Tox is free software: you can redistribute it and/or modify
13* 13 * it under the terms of the GNU General Public License as published by
14* Tox is distributed in the hope that it will be useful, 14 * the Free Software Foundation, either version 3 of the License, or
15* but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * (at your option) any later version.
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 *
17* GNU General Public License for more details. 17 * Tox is distributed in the hope that it will be useful,
18* 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19* You should have received a copy of the GNU General Public License 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20* along with Tox. If not, see <http://www.gnu.org/licenses/>. 20 * GNU General Public License for more details.
21* 21 *
22*/ 22 * You should have received a copy of the GNU General Public License
23 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
24 */
23#ifdef HAVE_CONFIG_H 25#ifdef HAVE_CONFIG_H
24#include "config.h" 26#include "config.h"
25#endif 27#endif
@@ -1523,7 +1525,7 @@ static int onion_isconnected(const Onion_Client *onion_c)
1523 } 1525 }
1524 1526
1525 /* Consider ourselves online if we are announced to half or more nodes 1527 /* Consider ourselves online if we are announced to half or more nodes
1526 we are connected to */ 1528 we are connected to */
1527 if (num && announced) { 1529 if (num && announced) {
1528 if ((num / 2) <= announced && (pnodes / 2) <= num) { 1530 if ((num / 2) <= announced && (pnodes / 2) <= num) {
1529 return 1; 1531 return 1;