aboutsummaryrefslogtreecommitdiff
path: root/src/network/connectionthreads.cpp
AgeCommit message (Collapse)Author
2022-11-09Fix typos and en_US/en_GB inconsistency in various files (#12902)Abdou-31
2022-05-04Make logging cost free when there is no output target (#12247)paradust7
The logging streams now do almost no work when there is no output target for them. For example, if LL_VERBOSE has no output targets, then `verbosestream << x` will return a StreamProxy with a null target. Any further `<<` operations applied to it will do nothing.
2021-12-01Network: Delete copy constructor and use std::move instead (#11642)SmallJoker
This is a follow-up change which disables class copies where possible to avoid unnecessary memory movements.
2021-10-12Remove broken timeout behavioursfan5
Code that relies on `resend_count` was added in 7ea4a03 and 247a1eb, but never worked. This was fixed in #11607 which caused the problem to surface. Hence undo the first commit entirely and change the logic of the second.
2021-09-17Shave off buffer copies in networking code (#11607)sfan5
2020-11-02Block attempts to connect to the client (#10589)red-001
A Minetest peer initiates a connection by sending a packet with an invalid peer_id, for whatever reason the code for doing this ran on both the client and the server meaning you could connect to a client if you knew what the address:port tuple it was listening on.
2020-07-23Replace std::list<session_t> in networking code (#10215)sfan5
2020-05-14network: Replace a fatal_error with just error loggingsfan5
2020-04-20Improve protocol-level receiving code (#9617)sfan5
2020-04-08Overall improvements to log messages (#9598)sfan5
Hide some unnecessarily verbose ones behind --trace or disable them entirely. Remove duplicate ones. Improve their contents in some places.
2020-04-08Miscellaneous networking improvements (#9611)sfan5
fixes #2862
2019-04-14Various network performance improvements (#8125)Jozef Behran
* Optimize packet construction functions Some of the functions that construct packets in connection.cpp are using a const reference to get the raw packet data to package and others use a value passed parameter to do that. The ones that use the value passed parameter suffer from performance hit as the rather bulky packet data gets a temporary copy when the parameter is passed before it lands at its final destination inside the newly constructed packet. The unnecessary temporary copy hurts quite badly as the underlying class (SharedBuffer) actually allocates the space for the data in the heap. Fix the performance hit by converting all of these value passed parameters to const references. I believe that this is what the author of the relevant code actually intended to do as there is a couple of packet construction helper functions that already use a const reference to get the raw data. * Optimize packet sender thread class Most of the data sending methods of the packet sender thread class use a value passed parameter for the packet data to be sent. This causes the rather bulky data to be allocated on the heap and copied, slowing the packet sending down. Convert these parameters to const references to avoid the performance hit. * Optimize packet receiver thread class The packet receiver and processor thread class has many methods (mostly packet handlers) that receive the packed data by value. This causes a performance hit that is actually worse than the one caused by the packet sender methods because the packet is first handed to the processPacket method which looks at the packet type stored in the header and then delegates the actual handling to one of the handlers. Both, processPacket and all the handlers get the packet data by value, leading to at least two unnecessary copies of the data (with malloc and all the slow bells and whistles of bulky classes). As there already is a few methods that use a const reference parameter for the packet data, convert all this value passed packets to const references.
2019-02-15Revert RTT fixes (#8187)ANAND
The reverted commit 968ce9af598024ec71e9ffb2d15c3997a13ad754 is suspected (through the use of bisection) of causing network slowdowns. Revert for now as we are close to release.
2018-07-14Remove legacy client handling code.Lars Hofhansl
2018-07-13Ensure that legacy mode is correctly disabled.Lars Hofhansl
2018-06-24Fix rtt >= 0.0f assertion and free_move crashSmallJoker
2018-06-23RTT fixes (#7428)you
* Few code updates * Do not show average RTT before timing out * Fix unwanted integer division in RTTStatistics * Fix float format, prettier jitter calculation * Use +=, 0.1f -> 100.0f for stronger average updates
2018-04-18Fix wrong channel number representation in logs (#7205)SmallJoker
2017-09-27Add session_t typedef + remove unused functions (#6470)Loïc Blot
* Add session_t typedef + remove unused functions u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
2017-09-03Network part requires SharedBuffers to be pass as valueLoic Blot
This can trigger unreproductible crashes due to concurrency problem on SharedBuffers This fixes #6354
2017-08-28Pass SharedBuffer as value to increment reference countLoïc Blot
This should fix #6332 Refcount is not increased due to reference, it can make this refcount incorrect in a multithread context
2017-08-25Network cleanup (#6310)Loïc Blot
* Move Connection threads to dedicated files + various cleanups * ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types * Various code style fixes * Code style with clang-format * Various SharedBuffer copy removal * SharedBuffer cannot be copied anymore using Buffer * Fix many SharedBuffer copy (thanks to delete operator)