Removed maximum packet size from configuration
It's a source side define now, because you should really only change this if you know what you are doing. Beautified the number for pre 2013-12-23, thanks to @dastgir. Fixed a warning which was added by the last commit and was issued with the default settings, thanks to @cydh. Follow up to f4b42b2
This commit is contained in:
parent
7489fab958
commit
c28c9f61be
@ -8,15 +8,6 @@ debug: no
|
|||||||
// How long can a socket stall before closing the connection (in seconds)
|
// How long can a socket stall before closing the connection (in seconds)
|
||||||
stall_time: 60
|
stall_time: 60
|
||||||
|
|
||||||
// Maximum allowed size for clients packets in bytes (default: 65535).
|
|
||||||
// NOTE: To reduce the size of reported packets, lower the values of defines, which
|
|
||||||
// have been customized, such as MAX_STORAGE, MAX_GUILD_STORAGE or MAX_CART.
|
|
||||||
// NOTE: Do not modify this setting, unless the client has been modified to support
|
|
||||||
// larger packets. The client will crash, when it receives larger packets.
|
|
||||||
socket_max_client_packet: 65535
|
|
||||||
// For clients before 2013-12-23 uncomment this
|
|
||||||
//socket_max_client_packet: 24576
|
|
||||||
|
|
||||||
//----- IP Rules Settings -----
|
//----- IP Rules Settings -----
|
||||||
|
|
||||||
// If IP's are checked when connecting.
|
// If IP's are checked when connecting.
|
||||||
|
@ -213,7 +213,7 @@ int naddr_ = 0; // # of ip addresses
|
|||||||
// Maximum packet size in bytes, which the client is able to handle.
|
// Maximum packet size in bytes, which the client is able to handle.
|
||||||
// Larger packets cause a buffer overflow and stack corruption.
|
// Larger packets cause a buffer overflow and stack corruption.
|
||||||
#if PACKETVER < 20131223
|
#if PACKETVER < 20131223
|
||||||
static size_t socket_max_client_packet = 24576;
|
static size_t socket_max_client_packet = 0x6000;
|
||||||
#else
|
#else
|
||||||
static size_t socket_max_client_packet = USHRT_MAX;
|
static size_t socket_max_client_packet = USHRT_MAX;
|
||||||
#endif
|
#endif
|
||||||
@ -1175,22 +1175,6 @@ int socket_config_read(const char* cfgName)
|
|||||||
ddos_autoreset = atoi(w2);
|
ddos_autoreset = atoi(w2);
|
||||||
else if (!strcmpi(w1,"debug"))
|
else if (!strcmpi(w1,"debug"))
|
||||||
access_debug = config_switch(w2);
|
access_debug = config_switch(w2);
|
||||||
else if (!strcmpi(w1,"socket_max_client_packet")){
|
|
||||||
socket_max_client_packet = strtoul(w2, NULL, 0);
|
|
||||||
|
|
||||||
#if PACKETVER < 20131223
|
|
||||||
if( socket_max_client_packet > 24576 ){
|
|
||||||
ShowWarning( "socket_max_client_packet: Value %u is to high. Defaulting to %u.\n", socket_max_client_packet, 24576 );
|
|
||||||
ShowWarning( "socket_max_client_packet: If you want to use this value consider upgrading your client to 2013-12-23 or newer.\n" );
|
|
||||||
socket_max_client_packet = 24576;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if( socket_max_client_packet > USHRT_MAX ){
|
|
||||||
ShowWarning( "socket_max_client_packet: Value %u is to high. Defaulting to %u.\n", socket_max_client_packet, USHRT_MAX );
|
|
||||||
socket_max_client_packet = USHRT_MAX;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmpi(w1, "import"))
|
else if (!strcmpi(w1, "import"))
|
||||||
socket_config_read(w2);
|
socket_config_read(w2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user