mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
7c1f645e27
There is a big mix of LockRefPtrs all over the Networking subsystem, as well as lots of room for improvements with our locking patterns, which this commit will not pursue, but will give a good start for such work. To deal with this situation, we change the following things: - Creating instances of NetworkAdapter should always yield a non-locking NonnullRefPtr. Acquiring an instance from the NetworkingManagement should give a simple RefPtr,as giving LockRefPtr does not really protect from concurrency problems in such case. - Since NetworkingManagement works with normal RefPtrs we should protect all instances of RefPtr<NetworkAdapter> with SpinlockProtected to ensure references are gone unexpectedly. - Protect the so_error class member with a proper spinlock. This happens to be important because the clear_so_error() method lacked any proper locking measures. It also helps preventing a possible TOCTOU when we might do a more fine-grained locking in the Socket code, so this could be definitely a start for this. - Change unnecessary LockRefPtr<PacketWithTimestamp> in the structure of OutgoingPacket to a simple RefPtr<PacketWithTimestamp> as the whole list should be MutexProtected. |
||
---|---|---|
.. | ||
Intel | ||
Realtek | ||
ARP.h | ||
EthernetFrameHeader.h | ||
EtherType.h | ||
ICMP.h | ||
IPv4.h | ||
IPv4Socket.cpp | ||
IPv4Socket.h | ||
IPv4SocketTuple.h | ||
LocalSocket.cpp | ||
LocalSocket.h | ||
LoopbackAdapter.cpp | ||
LoopbackAdapter.h | ||
NetworkAdapter.cpp | ||
NetworkAdapter.h | ||
NetworkingManagement.cpp | ||
NetworkingManagement.h | ||
NetworkTask.cpp | ||
NetworkTask.h | ||
Routing.cpp | ||
Routing.h | ||
Socket.cpp | ||
Socket.h | ||
TCP.h | ||
TCPSocket.cpp | ||
TCPSocket.h | ||
UDP.h | ||
UDPSocket.cpp | ||
UDPSocket.h |