mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Everywhere: Use CMake to generate AK/Debug.h.
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
This commit is contained in:
parent
76f2918416
commit
1a3a0836c0
59 changed files with 475 additions and 459 deletions
|
@ -169,7 +169,7 @@ KResultOr<size_t> TCPSocket::protocol_receive(ReadonlyBytes raw_ipv4_packet, Use
|
|||
auto& ipv4_packet = *reinterpret_cast<const IPv4Packet*>(raw_ipv4_packet.data());
|
||||
auto& tcp_packet = *static_cast<const TCPPacket*>(ipv4_packet.payload());
|
||||
size_t payload_size = raw_ipv4_packet.size() - sizeof(IPv4Packet) - tcp_packet.header_size();
|
||||
#ifdef TCP_SOCKET_DEBUG
|
||||
#if TCP_SOCKET_DEBUG
|
||||
klog() << "payload_size " << payload_size << ", will it fit in " << buffer_size << "?";
|
||||
#endif
|
||||
ASSERT(buffer_size >= payload_size);
|
||||
|
@ -252,7 +252,7 @@ void TCPSocket::send_outgoing_packets()
|
|||
packet.tx_time = now;
|
||||
packet.tx_counter++;
|
||||
|
||||
#ifdef TCP_SOCKET_DEBUG
|
||||
#if TCP_SOCKET_DEBUG
|
||||
auto& tcp_packet = *(TCPPacket*)(packet.buffer.data());
|
||||
klog() << "sending tcp packet from " << local_address().to_string().characters() << ":" << local_port() << " to " << peer_address().to_string().characters() << ":" << peer_port() << " with (" << (tcp_packet.has_syn() ? "SYN " : "") << (tcp_packet.has_ack() ? "ACK " : "") << (tcp_packet.has_fin() ? "FIN " : "") << (tcp_packet.has_rst() ? "RST " : "") << ") seq_no=" << tcp_packet.sequence_number() << ", ack_no=" << tcp_packet.ack_number() << ", tx_counter=" << packet.tx_counter;
|
||||
#endif
|
||||
|
@ -450,7 +450,7 @@ bool TCPSocket::protocol_is_disconnected() const
|
|||
void TCPSocket::shut_down_for_writing()
|
||||
{
|
||||
if (state() == State::Established) {
|
||||
#ifdef TCP_SOCKET_DEBUG
|
||||
#if TCP_SOCKET_DEBUG
|
||||
dbgln(" Sending FIN/ACK from Established and moving into FinWait1");
|
||||
#endif
|
||||
[[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
|
||||
|
@ -465,7 +465,7 @@ KResult TCPSocket::close()
|
|||
Locker socket_locker(lock());
|
||||
auto result = IPv4Socket::close();
|
||||
if (state() == State::CloseWait) {
|
||||
#ifdef TCP_SOCKET_DEBUG
|
||||
#if TCP_SOCKET_DEBUG
|
||||
dbgln(" Sending FIN from CloseWait and moving into LastAck");
|
||||
#endif
|
||||
[[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue