gdr / tuntox (public) (License: GPLv3) (since 2017-01-24) (hash sha1)
Tunnel TCP connections over the Tox protocol
List of commits:
Subject Hash Author Date (UTC)
Move friend-connection-lost to a separate state 121acd73ddba12659713f27abef7524b9a0c6a48 GDR! 2018-11-17 11:23:57
Retry on lost friend connection 03d83602d3a328d89b806e23c35644ec3908dc1f GDR! 2018-11-17 10:42:55
Print toxcore version in debug output 3adc626eb1646ee3456ca282e1855142f9f935e0 GDR! 2018-10-25 09:39:47
Recommend NoScriptâ„¢ for optimal viewing experience d2e2adc947ec929b831d6369421cd585b9e3d66b GDR! 2018-05-04 18:22:30
Fix typo in tokssh help 9f245199da5a9e82e76177832153053bc32852e9 GDR! 2018-04-10 09:50:13
Add config file to tokssh to map a memorable name to toxid b4444039e733acc3e20e5b85749d95dd9eae298b Fabio 2018-04-10 08:58:43
Put a shameful todo 64277a0a2f4cb8902c77f4d9867d18d980e51bc8 GDR! 2018-03-24 09:39:47
Friend connection status printed correctly 74a5c4adbfd0a0a4a1dda3aedc875bc04bcf3c34 GDR! 2018-03-24 09:19:12
Print DHT key in debug log 3b26f4eac390008113ca0d5c0978ed7da19dfa34 GDR! 2018-03-24 09:01:12
Log friend connection status changes f8f68e77d95bc81060c311cf2b92e883db3bfa79 GDR! 2018-03-24 08:58:12
Move FAQ link up 826ef1b9deea8d3f5f34ef523205571f8d9f5975 GDR! 2018-03-24 08:33:00
FAQ added 62d56bb6f4fc69bf5f4387fe8bdbe56c1590eefe GDR! 2018-03-24 08:25:22
c-toxcore 0.2.0 compatible pkg-config lib deps ef49516b967e1b3a1af777725554e5081ee0c688 GDR! 2018-03-12 19:59:44
Attempt at fixing double-free in issue #50 a6e3e443c5b788c7d1b43a1f9118d772a5a18f8d GDR! 2018-02-06 11:57:33
pre-push hook to check gitversion.h against tag b8c2242cafe33bda19c9774e2584be7508cb35f0 Jiachen Yang 2017-11-01 11:05:55
Generate gitversion.h only in git checkouts 44a23bb83ced58f9bf9e4368c507a5af0113ba48 GDR! 2017-11-01 11:04:42
Bump version to 0.0.8 c5438fbc05c1f2355c5484a2e67bc52531eb28cd GDR! 2017-11-01 10:52:34
Merge 71604ecf9c48a95c4a7fb7241b3e5fe2418c0e81 GDR! 2017-11-01 10:46:37
Bump version to 0.0.8 8abb89fdfcd2aaf3ff8c93e269588c007e10e66a GDR! 2017-11-01 10:42:49
Added gitversion.h to repo cce7a7f9af093d6e0a99c5848aa5fa3b967b6ebc GDR! 2017-11-01 10:38:17
Commit 121acd73ddba12659713f27abef7524b9a0c6a48 - Move friend-connection-lost to a separate state
Author: GDR!
Author date (UTC): 2018-11-17 11:23
Committer name: GDR!
Committer date (UTC): 2018-11-17 11:23
Parent(s): 03d83602d3a328d89b806e23c35644ec3908dc1f
Signer:
Signing key: 91E13DD923FE501F
Signing status: E
Tree: 46c775fff7bd6eed8aad8bc85e308358c52b60c4
File Lines added Lines deleted
client.c 36 11
client.h 1 0
gitversion.h 1 1
main.h 1 0
File client.c changed (mode: 100644) (index fa326ea..517b89e)
... ... int do_client_loop(uint8_t *tox_id_str)
281 281 uint32_t friendnumber = 0; uint32_t friendnumber = 0;
282 282 TOX_CONNECTION last_friend_connection_status = TOX_CONNECTION_NONE; TOX_CONNECTION last_friend_connection_status = TOX_CONNECTION_NONE;
283 283 time_t last_friend_connection_status_received = 0; time_t last_friend_connection_status_received = 0;
284 time_t connection_lost_timestamp = 0;
284 285 struct timeval tv; struct timeval tv;
285 286 fd_set fds; fd_set fds;
286 287 static time_t invitation_sent_time = 0; static time_t invitation_sent_time = 0;
 
... ... int do_client_loop(uint8_t *tox_id_str)
616 617
617 618 if(friend_connection_status == TOX_CONNECTION_NONE) if(friend_connection_status == TOX_CONNECTION_NONE)
618 619 { {
619 /* https://github.com/TokTok/c-toxcore/blob/acb6b2d8543c8f2ea0c2e60dc046767cf5cc0de8/toxcore/tox.h#L1267 */
620 TOX_ERR_FRIEND_DELETE tox_delete_error;
621
622 log_printf(L_WARNING, "Lost connection to server, closing all tunnels and re-adding friend\n");
623 client_close_all_connections();
624 tox_friend_delete(tox, friendnumber, &tox_delete_error);
625 if(tox_delete_error)
626 {
627 log_printf(L_ERROR, "Error when deleting server from friend list: %d\n", tox_delete_error);
628 }
629 state = CLIENT_STATE_INITIAL;
620 state = CLIENT_STATE_CONNECTION_LOST;
621 connection_lost_timestamp = time(NULL);
630 622 } }
631 623 } }
632 624
 
... ... int do_client_loop(uint8_t *tox_id_str)
636 628 } }
637 629 } }
638 630 break; break;
631 case CLIENT_STATE_CONNECTION_LOST:
632 {
633 TOX_CONNECTION friend_connection_status;
634 friend_connection_status = tox_friend_get_connection_status(tox, friendnumber, &friend_query_error);
635 if(friend_query_error != TOX_ERR_FRIEND_QUERY_OK)
636 {
637 log_printf(L_DEBUG, "tox_friend_get_connection_status: error %u\n", friend_query_error);
638 }
639 else
640 {
641 if(friend_connection_status == TOX_CONNECTION_NONE)
642 {
643 /* https://github.com/TokTok/c-toxcore/blob/acb6b2d8543c8f2ea0c2e60dc046767cf5cc0de8/toxcore/tox.h#L1267 */
644 TOX_ERR_FRIEND_DELETE tox_delete_error;
645
646 log_printf(L_WARNING, "Lost connection to server, closing all tunnels and re-adding friend\n");
647 client_close_all_connections();
648 tox_friend_delete(tox, friendnumber, &tox_delete_error);
649 if(tox_delete_error)
650 {
651 log_printf(L_ERROR, "Error when deleting server from friend list: %d\n", tox_delete_error);
652 }
653 state = CLIENT_STATE_INITIAL;
654 }
655 else
656 {
657 state = CLIENT_STATE_FORWARDING;
658 }
659 }
660 }
661 break;
662 case 0xffffffff:
663 log_printf(L_ERROR, "You forgot a break statement\n");
639 664 case CLIENT_STATE_SHUTDOWN: case CLIENT_STATE_SHUTDOWN:
640 665 exit(0); exit(0);
641 666 break; break;
File client.h changed (mode: 100644) (index db71d40..be68f25)
13 13 #define CLIENT_STATE_SHUTDOWN 11 #define CLIENT_STATE_SHUTDOWN 11
14 14 #define CLIENT_STATE_BIND_PORT 12 #define CLIENT_STATE_BIND_PORT 12
15 15 #define CLIENT_STATE_SETUP_PIPE 13 #define CLIENT_STATE_SETUP_PIPE 13
16 #define CLIENT_STATE_CONNECTION_LOST 14
16 17
17 18 int handle_pong_frame(); int handle_pong_frame();
18 19 int handle_acktunnel_frame(protocol_frame *rcvd_frame); int handle_acktunnel_frame(protocol_frame *rcvd_frame);
File gitversion.h changed (mode: 100644) (index 627af8a..3a987b8)
1 #define GITVERSION "3adc626eb1646ee3456ca282e1855142f9f935e0"
1 #define GITVERSION "03d83602d3a328d89b806e23c35644ec3908dc1f"
File main.h changed (mode: 100644) (index 90f393e..17fb9b9)
4 4 #include <arpa/inet.h> #include <arpa/inet.h>
5 5 #include <errno.h> #include <errno.h>
6 6 #include <fcntl.h> #include <fcntl.h>
7 #include <limits.h>
7 8 #include <netdb.h> #include <netdb.h>
8 9 #include <netinet/in.h> #include <netinet/in.h>
9 10 #include <pwd.h> #include <pwd.h>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/gdr/tuntox

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/gdr/tuntox

Clone this repository using git:
git clone git://git.rocketgit.com/user/gdr/tuntox

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main