diff options
author | Andrew Cady <d@jerkface.net> | 2020-08-23 23:39:06 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-08-23 23:39:06 -0400 |
commit | 702b610636012b8f9247c3bbc1d39cd8bddde7b2 (patch) | |
tree | 1b84581d0c57c25cb2094e71e2cb15085ac78166 | |
parent | 17c8cbf9c0c2e86ce91a9570d5f6a66fd5d366c3 (diff) |
tighter variable scope
-rw-r--r-- | client.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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"); |