Index: src/network/network_content.cpp =================================================================== --- src/network/network_content.cpp (revision 27546) +++ src/network/network_content.cpp (working copy) @@ -57,7 +57,7 @@ ci->filesize = p->Recv_uint32(); p->Recv_string(ci->name, lengthof(ci->name)); - p->Recv_string(ci->version, lengthof(ci->name)); + p->Recv_string(ci->version, lengthof(ci->version)); p->Recv_string(ci->url, lengthof(ci->url)); p->Recv_string(ci->description, lengthof(ci->description), SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE); @@ -220,10 +220,9 @@ while (count > 0) { /* We can "only" send a limited number of IDs in a single packet. * A packet begins with the packet size and a byte for the type. - * Then this packet adds a byte for the content type and a uint16 - * for the count in this packet. The rest of the packet can be - * used for the IDs. */ - uint p_count = min(count, (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32)); + * 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 = min(count, (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint16)) / sizeof(uint32)); Packet *p = new Packet(PACKET_CONTENT_CLIENT_INFO_ID); p->Send_uint16(p_count); @@ -249,9 +248,9 @@ this->Connect(); - /* 20 is sizeof(uint32) + sizeof(md5sum (byte[16])) */ assert(cv->Length() < 255); - assert(cv->Length() < (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) / (send_md5sum ? 20 : sizeof(uint32))); + assert(cv->Length() < (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) / + (sizeof(uint8) + sizeof(uint32) + (send_md5sum ? sizeof(ContentInfo::md5sum) : 0))); Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID); p->Send_uint8(cv->Length());