diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-04-10 21:32:55 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-04-10 21:32:55 +0800 |
commit | c0d7c6693f579a814c50d7965f8e89fa470b2c03 (patch) | |
tree | 2849eecd34082294145fdf16a8c2c8446f1d4a06 /common-channel.c | |
parent | 3ec467047856eb76945dc7804d1ba7743935fb2d (diff) |
run closehandlers on cleanup
Diffstat (limited to 'common-channel.c')
-rw-r--r-- | common-channel.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common-channel.c b/common-channel.c index 331ea60..8b7369c 100644 --- a/common-channel.c +++ b/common-channel.c @@ -561,7 +561,11 @@ static void remove_channel(struct Channel * channel) { 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 @@ static void send_msg_channel_data(struct Channel *channel, int isextended) { * 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; |