Skip to content

Commit

Permalink
fix: Reduce logging verbosity even more.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 6, 2022
1 parent fedcdea commit 79eb17a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
36b0bc23d8d2e78739afc2e2f6b7d44a822994d365f98bc802728e655d87d503 /usr/local/bin/tox-bootstrapd
739b0d6d431aa5cfd73e81002f09733ec44740c8de8f38eed651dc26c8c9a102 /usr/local/bin/tox-bootstrapd
2 changes: 1 addition & 1 deletion toxcore/TCP_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int read_TCP_packet(const Logger *logger, Socket sock, uint8_t *data, uint16_t l
const uint16_t count = net_socket_data_recv_buffer(sock);

if (count < length) {
LOGGER_INFO(logger, "recv buffer has %d bytes, but requested %d bytes", count, length);
LOGGER_TRACE(logger, "recv buffer has %d bytes, but requested %d bytes", count, length);
return -1;
}

Expand Down
20 changes: 10 additions & 10 deletions toxcore/TCP_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static int read_connection_handshake(const Logger *logger, TCP_Secure_Connection
const int len = read_TCP_packet(logger, con->con.sock, data, TCP_CLIENT_HANDSHAKE_SIZE, &con->con.ip_port);

if (len == -1) {
LOGGER_WARNING(logger, "connection handshake is not ready yet");
LOGGER_TRACE(logger, "connection handshake is not ready yet");
return 0;
}

Expand Down Expand Up @@ -904,12 +904,12 @@ static int do_incoming(TCP_Server *tcp_server, uint32_t i)
return -1;
}

LOGGER_DEBUG(tcp_server->logger, "handling incoming TCP connection %d", i);
LOGGER_TRACE(tcp_server->logger, "handling incoming TCP connection %d", i);

const int ret = read_connection_handshake(tcp_server->logger, conn, tcp_server->secret_key);

if (ret == -1) {
LOGGER_DEBUG(tcp_server->logger, "incoming connection %d dropped due to failed handshake", i);
LOGGER_TRACE(tcp_server->logger, "incoming connection %d dropped due to failed handshake", i);
kill_TCP_secure_connection(conn);
return -1;
}
Expand Down Expand Up @@ -941,7 +941,7 @@ static int do_unconfirmed(TCP_Server *tcp_server, const Mono_Time *mono_time, ui
return -1;
}

LOGGER_DEBUG(tcp_server->logger, "handling unconfirmed TCP connection %d", i);
LOGGER_TRACE(tcp_server->logger, "handling unconfirmed TCP connection %d", i);

uint8_t packet[MAX_PACKET_SIZE];
const int len = read_packet_TCP_secure_connection(tcp_server->logger, conn->con.sock, &conn->next_packet_length,
Expand Down Expand Up @@ -978,7 +978,7 @@ static bool tcp_process_secure_packet(TCP_Server *tcp_server, uint32_t i)
}

if (handle_TCP_packet(tcp_server, i, packet, len) == -1) {
LOGGER_DEBUG(tcp_server->logger, "dropping connection %d: data packet (len=%d) not handled", i, len);
LOGGER_TRACE(tcp_server->logger, "dropping connection %d: data packet (len=%d) not handled", i, len);
kill_accepted(tcp_server, i);
return false;
}
Expand Down Expand Up @@ -1088,19 +1088,19 @@ static bool tcp_epoll_process(TCP_Server *tcp_server, const Mono_Time *mono_time
}

case TCP_SOCKET_INCOMING: {
LOGGER_DEBUG(tcp_server->logger, "incoming connection %d dropped", index);
LOGGER_TRACE(tcp_server->logger, "incoming connection %d dropped", index);
kill_TCP_secure_connection(&tcp_server->incoming_connection_queue[index]);
break;
}

case TCP_SOCKET_UNCONFIRMED: {
LOGGER_DEBUG(tcp_server->logger, "unconfirmed connection %d dropped", index);
LOGGER_TRACE(tcp_server->logger, "unconfirmed connection %d dropped", index);
kill_TCP_secure_connection(&tcp_server->unconfirmed_connection_queue[index]);
break;
}

case TCP_SOCKET_CONFIRMED: {
LOGGER_DEBUG(tcp_server->logger, "confirmed connection %d dropped", index);
LOGGER_TRACE(tcp_server->logger, "confirmed connection %d dropped", index);
kill_accepted(tcp_server, index);
break;
}
Expand Down Expand Up @@ -1150,7 +1150,7 @@ static bool tcp_epoll_process(TCP_Server *tcp_server, const Mono_Time *mono_time
const int index_new = do_incoming(tcp_server, index);

if (index_new != -1) {
LOGGER_DEBUG(tcp_server->logger, "incoming connection %d was accepted as %d", index, index_new);
LOGGER_TRACE(tcp_server->logger, "incoming connection %d was accepted as %d", index, index_new);
events[n].events = EPOLLIN | EPOLLET | EPOLLRDHUP;
events[n].data.u64 = sock.socket | ((uint64_t)TCP_SOCKET_UNCONFIRMED << 32) | ((uint64_t)index_new << 40);

Expand All @@ -1168,7 +1168,7 @@ static bool tcp_epoll_process(TCP_Server *tcp_server, const Mono_Time *mono_time
const int index_new = do_unconfirmed(tcp_server, mono_time, index);

if (index_new != -1) {
LOGGER_DEBUG(tcp_server->logger, "unconfirmed connection %d was confirmed as %d", index, index_new);
LOGGER_TRACE(tcp_server->logger, "unconfirmed connection %d was confirmed as %d", index, index_new);
events[n].events = EPOLLIN | EPOLLET | EPOLLRDHUP;
events[n].data.u64 = sock.socket | ((uint64_t)TCP_SOCKET_CONFIRMED << 32) | ((uint64_t)index_new << 40);

Expand Down

0 comments on commit 79eb17a

Please sign in to comment.