# HG changeset patch # User Matt Johnston # Date 1365600775 -28800 # Node ID 7577a3afc42d83c80153382b34d02c5c5aba0012 # Parent b2d4205b089782e1a1624267d43fc8335b505f29 run closehandlers on cleanup diff -r b2d4205b0897 -r 7577a3afc42d common-channel.c --- a/common-channel.c Wed Apr 10 21:32:44 2013 +0800 +++ b/common-channel.c Wed Apr 10 21:32:55 2013 +0800 @@ -561,7 +561,11 @@ TRACE(("CLOSE errfd %d", channel->errfd)) close(channel->errfd); - channel->typedata = NULL; + if (!channel->close_handler_done + && channel->type->closehandler) { + channel->type->closehandler(channel); + channel->close_handler_done = 1; + } ses.channels[channel->index] = NULL; m_free(channel); @@ -625,7 +629,7 @@ * exttype if is extended */ maxlen = MIN(maxlen, ses.writepayload->size - 1 - 4 - 4 - (isextended ? 4 : 0)); - TRACE(("maxlen %d", maxlen)) + TRACE(("maxlen %zd", maxlen)) if (maxlen == 0) { TRACE(("leave send_msg_channel_data: no window")) return;