Changeset - r25272:abea9ded78de
[Not reviewed]
master
0 1 0
Rubidium - 3 years ago 2021-04-18 12:59:23
rubidium@openttd.org
Change: use 32 KiB packets to send requests to the content server
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/network/network_content.cpp
Show inline comments
 
@@ -221,9 +221,9 @@ void ClientNetworkContentSocketHandler::
 
		 * A packet begins with the packet size and a byte for the type.
 
		 * Then this packet adds a uint16 for the count in this packet.
 
		 * The rest of the packet can be used for the IDs. */
 
		uint p_count = std::min<uint>(count, (COMPAT_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32));
 
		uint p_count = std::min<uint>(count, (TCP_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32));
 

	
 
		Packet *p = new Packet(PACKET_CONTENT_CLIENT_INFO_ID, COMPAT_MTU);
 
		Packet *p = new Packet(PACKET_CONTENT_CLIENT_INFO_ID, TCP_MTU);
 
		p->Send_uint16(p_count);
 

	
 
		for (uint i = 0; i < p_count; i++) {
 
@@ -248,10 +248,10 @@ void ClientNetworkContentSocketHandler::
 
	this->Connect();
 

	
 
	assert(cv->size() < 255);
 
	assert(cv->size() < (COMPAT_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) /
 
	assert(cv->size() < (TCP_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) /
 
			(sizeof(uint8) + sizeof(uint32) + (send_md5sum ? /*sizeof(ContentInfo::md5sum)*/16 : 0)));
 

	
 
	Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID);
 
	Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID, TCP_MTU);
 
	p->Send_uint8((uint8)cv->size());
 

	
 
	for (const ContentInfo *ci : *cv) {
 
@@ -363,9 +363,9 @@ void ClientNetworkContentSocketHandler::
 
		 * A packet begins with the packet size and a byte for the type.
 
		 * Then this packet adds a uint16 for the count in this packet.
 
		 * The rest of the packet can be used for the IDs. */
 
		uint p_count = std::min<uint>(count, (COMPAT_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32));
 
		uint p_count = std::min<uint>(count, (TCP_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32));
 

	
 
		Packet *p = new Packet(PACKET_CONTENT_CLIENT_CONTENT);
 
		Packet *p = new Packet(PACKET_CONTENT_CLIENT_CONTENT, TCP_MTU);
 
		p->Send_uint16(p_count);
 

	
 
		for (uint i = 0; i < p_count; i++) {
0 comments (0 inline, 0 general)