summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGDR! <gdr@gdr.name>2018-03-24 10:19:12 +0100
committerGDR! <gdr@gdr.name>2018-03-24 10:19:12 +0100
commit74a5c4adbfd0a0a4a1dda3aedc875bc04bcf3c34 (patch)
tree284dc9f97f7e01839c6cd2a54024c85b75de96bb
parent3b26f4eac390008113ca0d5c0978ed7da19dfa34 (diff)
Friend connection status printed correctly
-rw-r--r--FAQ.md6
-rw-r--r--client.c4
-rw-r--r--gitversion.h2
-rw-r--r--util.c1
4 files changed, 10 insertions, 3 deletions
diff --git a/FAQ.md b/FAQ.md
index b25685d..887d69e 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -41,6 +41,12 @@ The connection is likely to have worse latency when you see the following:
412018-03-24 08:57:21: [INFO] Friend request accepted (A TCP connection has been established (via TCP relay))! 412018-03-24 08:57:21: [INFO] Friend request accepted (A TCP connection has been established (via TCP relay))!
42``` 42```
43 43
44There's, however, a chance that it will upgrade to UDP after a few minutes:
45
46```
472018-03-24 10:17:06: [INFO] Friend connection status changed to: An UDP connection has been established
48```
49
44## I have a direct UDP connection. Why isn't my connection faster? 50## I have a direct UDP connection. Why isn't my connection faster?
45 51
46Wait until https://github.com/gjedeer/tuntox/issues/41 is implemented. This change should improve speed and latency in the 10 Mbit/s+ range. 52Wait until https://github.com/gjedeer/tuntox/issues/41 is implemented. This change should improve speed and latency in the 10 Mbit/s+ range.
diff --git a/client.c b/client.c
index 197d840..0e8fc18 100644
--- a/client.c
+++ b/client.c
@@ -33,7 +33,7 @@ int handle_pong_frame()
33 secs1 = (1.0 * ping_sent_time.tv_sec) + (1e-9 * ping_sent_time.tv_nsec); 33 secs1 = (1.0 * ping_sent_time.tv_sec) + (1e-9 * ping_sent_time.tv_nsec);
34 secs2 = (1.0 * pong_rcvd_time.tv_sec) + (1e-9 * pong_rcvd_time.tv_nsec); 34 secs2 = (1.0 * pong_rcvd_time.tv_sec) + (1e-9 * pong_rcvd_time.tv_nsec);
35 35
36 printf("GOT PONG! Time = %.3fs\n", secs2-secs1); 36 log_printf(L_INFO, "GOT PONG! Time = %.3fs\n", secs2-secs1);
37 37
38 if(ping_mode) 38 if(ping_mode)
39 { 39 {
@@ -582,7 +582,7 @@ int do_client_loop(uint8_t *tox_id_str)
582 friend_connection_status = tox_friend_get_connection_status(tox, friendnumber, &friend_query_error); 582 friend_connection_status = tox_friend_get_connection_status(tox, friendnumber, &friend_query_error);
583 if(friend_query_error != TOX_ERR_FRIEND_QUERY_OK) 583 if(friend_query_error != TOX_ERR_FRIEND_QUERY_OK)
584 { 584 {
585 log_printf(L_DEBUG, "tox_friend_get_connection_status: error %u", friend_query_error); 585 log_printf(L_DEBUG, "tox_friend_get_connection_status: error %u\n", friend_query_error);
586 } 586 }
587 else 587 else
588 { 588 {
diff --git a/gitversion.h b/gitversion.h
index d4b7062..f446268 100644
--- a/gitversion.h
+++ b/gitversion.h
@@ -1 +1 @@
#define GITVERSION "a6e3e443c5b788c7d1b43a1f9118d772a5a18f8d" #define GITVERSION "3b26f4eac390008113ca0d5c0978ed7da19dfa34"
diff --git a/util.c b/util.c
index 4d75fe5..3e6a99c 100644
--- a/util.c
+++ b/util.c
@@ -198,6 +198,7 @@ const char *readable_connection_status(TOX_CONNECTION status)
198 case TOX_CONNECTION_UDP: 198 case TOX_CONNECTION_UDP:
199 return "An UDP connection has been established"; 199 return "An UDP connection has been established";
200 default: 200 default:
201 log_printf(L_WARNING, "Received unknown connection status %d\n", (int)status);
201 return "Unknown connection status"; 202 return "Unknown connection status";
202 } 203 }
203} 204}