summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-08-20 06:42:18 -0400
committerAndrew Cady <d@jerkface.net>2020-08-20 16:29:56 -0400
commit5d1bce667f97244718bbeaff42bade637782c6ba (patch)
treea5d5d2915127bf173a03c5ac34b5bdce930a89f4 /client.c
parentde62d93767d02a6c4768936670b668eca5f3fafe (diff)
whitespace fixes
Diffstat (limited to 'client.c')
-rw-r--r--client.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/client.c b/client.c
index 3073e5d..1e02286 100644
--- a/client.c
+++ b/client.c
@@ -310,12 +310,12 @@ int do_client_loop(uint8_t *tox_id_str)
310 310
311 while(1) 311 while(1)
312 { 312 {
313 /* Let tox do its stuff */ 313 /* Let tox do its stuff */
314 tox_iterate(tox, NULL); 314 tox_iterate(tox, NULL);
315 315
316 switch(state) 316 switch(state)
317 { 317 {
318 /* 318 /*
319 * Send friend request 319 * Send friend request
320 */ 320 */
321 case CLIENT_STATE_INITIAL: 321 case CLIENT_STATE_INITIAL:
@@ -501,7 +501,7 @@ int do_client_loop(uint8_t *tox_id_str)
501 tv.tv_sec = 0; 501 tv.tv_sec = 0;
502 tv.tv_usec = 20000; 502 tv.tv_usec = 20000;
503 fds = client_master_fdset; 503 fds = client_master_fdset;
504 504
505 /* Handle accepting new connections */ 505 /* Handle accepting new connections */
506 if(!client_pipe_mode && 506 if(!client_pipe_mode &&
507 client_tunnel.sockfd <= 0) /* Don't accept if we're already waiting to establish a tunnel */ 507 client_tunnel.sockfd <= 0) /* Don't accept if we're already waiting to establish a tunnel */
@@ -628,39 +628,39 @@ int do_client_loop(uint8_t *tox_id_str)
628 } 628 }
629 } 629 }
630 break; 630 break;
631 case CLIENT_STATE_CONNECTION_LOST: 631 case CLIENT_STATE_CONNECTION_LOST:
632 { 632 {
633 TOX_CONNECTION friend_connection_status; 633 TOX_CONNECTION friend_connection_status;
634 friend_connection_status = tox_friend_get_connection_status(tox, friendnumber, &friend_query_error); 634 friend_connection_status = tox_friend_get_connection_status(tox, friendnumber, &friend_query_error);
635 if(friend_query_error != TOX_ERR_FRIEND_QUERY_OK) 635 if(friend_query_error != TOX_ERR_FRIEND_QUERY_OK)
636 { 636 {
637 log_printf(L_DEBUG, "tox_friend_get_connection_status: error %u\n", friend_query_error); 637 log_printf(L_DEBUG, "tox_friend_get_connection_status: error %u\n", friend_query_error);
638 } 638 }
639 else 639 else
640 { 640 {
641 if(friend_connection_status == TOX_CONNECTION_NONE) 641 if(friend_connection_status == TOX_CONNECTION_NONE)
642 { 642 {
643 /* https://github.com/TokTok/c-toxcore/blob/acb6b2d8543c8f2ea0c2e60dc046767cf5cc0de8/toxcore/tox.h#L1267 */ 643 /* https://github.com/TokTok/c-toxcore/blob/acb6b2d8543c8f2ea0c2e60dc046767cf5cc0de8/toxcore/tox.h#L1267 */
644 TOX_ERR_FRIEND_DELETE tox_delete_error; 644 TOX_ERR_FRIEND_DELETE tox_delete_error;
645 645
646 log_printf(L_WARNING, "Lost connection to server, closing all tunnels and re-adding friend\n"); 646 log_printf(L_WARNING, "Lost connection to server, closing all tunnels and re-adding friend\n");
647 client_close_all_connections(); 647 client_close_all_connections();
648 tox_friend_delete(tox, friendnumber, &tox_delete_error); 648 tox_friend_delete(tox, friendnumber, &tox_delete_error);
649 if(tox_delete_error) 649 if(tox_delete_error)
650 { 650 {
651 log_printf(L_ERROR, "Error when deleting server from friend list: %d\n", tox_delete_error); 651 log_printf(L_ERROR, "Error when deleting server from friend list: %d\n", tox_delete_error);
652 } 652 }
653 state = CLIENT_STATE_INITIAL; 653 state = CLIENT_STATE_INITIAL;
654 } 654 }
655 else 655 else
656 { 656 {
657 state = CLIENT_STATE_FORWARDING; 657 state = CLIENT_STATE_FORWARDING;
658 } 658 }
659 } 659 }
660 } 660 }
661 break; 661 break;
662 case 0xffffffff: 662 case 0xffffffff:
663 log_printf(L_ERROR, "You forgot a break statement\n"); 663 log_printf(L_ERROR, "You forgot a break statement\n");
664 case CLIENT_STATE_SHUTDOWN: 664 case CLIENT_STATE_SHUTDOWN:
665 exit(0); 665 exit(0);
666 break; 666 break;