diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-15 04:50:51 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-15 04:50:51 +0000 |
commit | c9a0b6b049054a60d0d43af1505e873c5b26a5a8 (patch) | |
tree | 003bf273706178d539ffe8375d14d1cf6b954a6e /src/common/socket.c | |
parent | 1d02588929b3d2e8a28de5f57a4cb748f157a4ed (diff) | |
download | hercules-c9a0b6b049054a60d0d43af1505e873c5b26a5a8.tar.gz hercules-c9a0b6b049054a60d0d43af1505e873c5b26a5a8.tar.bz2 hercules-c9a0b6b049054a60d0d43af1505e873c5b26a5a8.tar.xz hercules-c9a0b6b049054a60d0d43af1505e873c5b26a5a8.zip |
Fixed gm_all_skill, bugreport:5239
Removed broken skills from skill tree, so @allskill doesn't give resource errors when gm_all_skill is enabled.
Increased maximum client packet size drop limit (was limiting gm_all_skill unnecessarily since the client doesn't crash with it)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15462 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.c')
-rw-r--r-- | src/common/socket.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index e7f1034ae..36e99dbf5 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -208,7 +208,7 @@ int naddr_ = 0; // # of ip addresses // 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 = 20480; +static size_t socket_max_client_packet = 24576; // initial recv buffer size (this will also be the max. size) // biggest known packet: S 0153 <len>.w <emblem data>.?B -> 24x24 256 color .bmp (0153 + len.w + 1618/1654/1756 bytes) @@ -660,19 +660,20 @@ int WFIFOSET(int fd, size_t len) return 0; } - if( !s->flag.server && len > socket_max_client_packet ) - {// see declaration of socket_max_client_packet for details - ShowError("WFIFOSET: Dropped too large client packet 0x%04x (length=%u, max=%u).\n", WFIFOW(fd,0), len, socket_max_client_packet); - return 0; - } + if( !s->flag.server ) { - if( !s->flag.server && s->wdata_size+len > WFIFO_MAX ) - {// reached maximum write fifo size - ShowError("WFIFOSET: Maximum write buffer size for client connection %d exceeded, most likely caused by packet 0x%04x (len=%u, ip=%lu.%lu.%lu.%lu).\n", fd, WFIFOW(fd,0), len, CONVIP(s->client_addr)); - set_eof(fd); - return 0; - } + if( len > socket_max_client_packet ) {// see declaration of socket_max_client_packet for details + ShowError("WFIFOSET: Dropped too large client packet 0x%04x (length=%u, max=%u).\n", WFIFOW(fd,0), len, socket_max_client_packet); + return 0; + } + + if( s->wdata_size+len > WFIFO_MAX ) {// reached maximum write fifo size + ShowError("WFIFOSET: Maximum write buffer size for client connection %d exceeded, most likely caused by packet 0x%04x (len=%u, ip=%lu.%lu.%lu.%lu).\n", fd, WFIFOW(fd,0), len, CONVIP(s->client_addr)); + set_eof(fd); + return 0; + } + } s->wdata_size += len; //If the interserver has 200% of its normal size full, flush the data. if( s->flag.server && s->wdata_size >= 2*FIFOSIZE_SERVERLINK ) |