Changeset - r25200:4496417abe2b
[Not reviewed]
master
0 2 0
Patric Stout - 3 years ago 2021-04-20 14:34:14
truebrain@openttd.org
Codechange: remove always-empty "address" from NetworkContentSocketHandler

When ever you saw this debug lines (which you never should), they
showed an empty address. It is also not very useful to have, as it
always points to a known server anyway.
2 files changed with 5 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/network/core/tcp_content.cpp
Show inline comments
 
@@ -171,9 +171,9 @@ bool NetworkContentSocketHandler::Handle
 

	
 
		default:
 
			if (this->HasClientQuit()) {
 
				DEBUG(net, 0, "[tcp/content] received invalid packet type %d from %s", type, this->client_addr.GetAddressAsString().c_str());
 
				DEBUG(net, 0, "[tcp/content] received invalid packet type %d", type);
 
			} else {
 
				DEBUG(net, 0, "[tcp/content] received illegal packet from %s", this->client_addr.GetAddressAsString().c_str());
 
				DEBUG(net, 0, "[tcp/content] received illegal packet");
 
			}
 
			return false;
 
	}
 
@@ -224,7 +224,7 @@ bool NetworkContentSocketHandler::Receiv
 
 */
 
bool NetworkContentSocketHandler::ReceiveInvalidPacket(PacketContentType type)
 
{
 
	DEBUG(net, 0, "[tcp/content] received illegal packet type %d from %s", type, this->client_addr.GetAddressAsString().c_str());
 
	DEBUG(net, 0, "[tcp/content] received illegal packet type %d", type);
 
	return false;
 
}
 

	
src/network/core/tcp_content.h
Show inline comments
 
@@ -95,7 +95,6 @@ struct ContentInfo {
 
/** Base socket handler for all Content TCP sockets */
 
class NetworkContentSocketHandler : public NetworkTCPSocketHandler {
 
protected:
 
	NetworkAddress client_addr; ///< The address we're connected to.
 
	void Close() override;
 

	
 
	bool ReceiveInvalidPacket(PacketContentType type);
 
@@ -193,9 +192,8 @@ public:
 
	 * @param s  the socket we are connected with
 
	 * @param address IP etc. of the client
 
	 */
 
	NetworkContentSocketHandler(SOCKET s = INVALID_SOCKET, const NetworkAddress &address = NetworkAddress()) :
 
		NetworkTCPSocketHandler(s),
 
		client_addr(address)
 
	NetworkContentSocketHandler(SOCKET s = INVALID_SOCKET) :
 
		NetworkTCPSocketHandler(s)
 
	{
 
	}
 

	
0 comments (0 inline, 0 general)