summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-08-23 23:39:06 -0400
committerAndrew Cady <d@jerkface.net>2020-08-23 23:39:06 -0400
commit702b610636012b8f9247c3bbc1d39cd8bddde7b2 (patch)
tree1b84581d0c57c25cb2094e71e2cb15085ac78166
parent17c8cbf9c0c2e86ce91a9570d5f6a66fd5d366c3 (diff)
tighter variable scope
-rw-r--r--client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/client.c b/client.c
index 1561590..61d1fec 100644
--- a/client.c
+++ b/client.c
@@ -269,7 +269,6 @@ void client_connected_loop_iteration(uint32_t friendnumber, struct tox_timer *t)
269 static unsigned char tox_packet_buf[PROTOCOL_MAX_PACKET_SIZE]; 269 static unsigned char tox_packet_buf[PROTOCOL_MAX_PACKET_SIZE];
270 static fd_set fds; 270 static fd_set fds;
271 271
272 int accept_fd = 0;
273 int select_rv = 0; 272 int select_rv = 0;
274 tunnel *tmp = NULL; 273 tunnel *tmp = NULL;
275 tunnel *tun = NULL; 274 tunnel *tun = NULL;
@@ -279,8 +278,8 @@ void client_connected_loop_iteration(uint32_t friendnumber, struct tox_timer *t)
279 /* Handle accepting new connections */ 278 /* Handle accepting new connections */
280 if(client_tunnel.sockfd <= 0) /* Don't accept if we're already waiting to establish a tunnel */ 279 if(client_tunnel.sockfd <= 0) /* Don't accept if we're already waiting to establish a tunnel */
281 { 280 {
282 accept_fd = accept(bind_sockfd, NULL, NULL);
283 log_printf(L_DEBUG4, "calling accept(%d)", bind_sockfd); 281 log_printf(L_DEBUG4, "calling accept(%d)", bind_sockfd);
282 int accept_fd = accept(bind_sockfd, NULL, NULL);
284 if(accept_fd != -1) 283 if(accept_fd != -1)
285 { 284 {
286 log_printf(L_INFO, "Accepting a new connection - requesting tunnel...\n"); 285 log_printf(L_INFO, "Accepting a new connection - requesting tunnel...\n");