diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-17 13:52:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-17 13:52:39 +0300 |
commit | 590fcf04372ac04e098d8499a5d3e8c9adc0981d (patch) | |
tree | 11eccbc4e6f617a0216f59c1e77ad40eb6851161 | |
parent | d4460ce0fcca62cd4fe6d45b12c55eb286244fee (diff) | |
parent | 96759fdd5dbc222c3d693f68c85a98b5557bf405 (diff) | |
download | hercules-590fcf04372ac04e098d8499a5d3e8c9adc0981d.tar.gz hercules-590fcf04372ac04e098d8499a5d3e8c9adc0981d.tar.bz2 hercules-590fcf04372ac04e098d8499a5d3e8c9adc0981d.tar.xz hercules-590fcf04372ac04e098d8499a5d3e8c9adc0981d.zip |
Merge pull request #917 from dastgir/packet
Update max packet size according to client date
-rw-r--r-- | conf/packet.conf | 7 | ||||
-rw-r--r-- | src/common/socket.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/conf/packet.conf b/conf/packet.conf index 33de0e901..3a7ec2c85 100644 --- a/conf/packet.conf +++ b/conf/packet.conf @@ -10,12 +10,15 @@ debug: no // How long can a socket stall before closing the connection (in seconds)? stall_time: 60 -// Maximum allowed size for clients packets in bytes (default: 24576). +// Maximum allowed size for clients packets in bytes (default: 65535). +// Default Values: +// 24576 (Clients < 20131223) +// 65535 (Clients >= 20131223) // 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: 24576 +//socket_max_client_packet: 65535 //----- IP Rules Settings ----- diff --git a/src/common/socket.c b/src/common/socket.c index 87575f5c3..f67c3d074 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -254,7 +254,11 @@ fd_set readfds; // Maximum packet size in bytes, which the client is able to handle. // Larger packets cause a buffer overflow and stack corruption. -static size_t socket_max_client_packet = 24576; +#if PACKETVER >= 20131223 +static size_t socket_max_client_packet = 0xFFFF; +#else +static size_t socket_max_client_packet = 0x6000; +#endif #ifdef SHOW_SERVER_STATS // Data I/O statistics |