Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing, Yahoo!, DotBot, Sogou

Members: 0
Guests: 4
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » AFKMud Bugfix List » [Bug] compressEnd does not fr...
Forum Rules | Mark all | Recent Posts

[Bug] compressEnd does not free up the MCCP buffer if data fails to send.
< Newer Topic :: Older Topic > AFKMud 2.1.3

Pages:<< prev 1 next >>
Post is unread #1 Mar 7, 2010, 11:46 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: compressEnd does not free up the MCCP buffer if data fails to send.
Danger: Medium - If you have a lot of people using MCCP disconnecting regularly and not able to receive data, it leaks 4096 bytes every time that happens.
Discovered in: AFKMud 2.1.3
Found by: Nick Gammon
Fixed by: Nick Gammon

---

features.cpp, descriptor_data::compressEnd

Locate:
   if( deflate( mccp->out_compress, Z_FINISH ) != Z_STREAM_END )
      return false;

   if( !process_compressed(  ) ) /* try to send any residual data */
      return false;


Change to:
   if( deflate( mccp->out_compress, Z_FINISH ) == Z_STREAM_END )
      process_compressed();   /* try to send any residual data */


As explained by Nick, if data can't be written to the descriptor when shutting down compression, a chunk of 4096 bytes will be left leaking.

Enough players doing this by disconnecting and reconnecting a lot can lead to substantial memory loss and lead to the need for premature reboots.
       
Pages:<< prev 1 next >>