Commit 083f3728 authored by Niels Möller's avatar Niels Möller
Browse files

* src/channel.h (ssh_channel): Let the close method return a

status value.
* src/channel.c (channel_process_status): Moved processing of
LSH_CHANNEL_PENDING_CLOSE after LSH_CHANNEL_FINISHED. This way, it
is possible for the channels close-callback to return
LSH_CHANNEL_PENDING_CLOSE.

Rev: src/channel.c:1.36
Rev: src/channel.h:1.31
parent 4b3c3080
......@@ -284,24 +284,24 @@ static int channel_process_status(struct channel_table *table,
break;
}
if (status & LSH_CHANNEL_PENDING_CLOSE)
table->pending_close = 1;
if (status & LSH_CHANNEL_FINISHED)
{
/* Clear this bit */
status &= ~LSH_CHANNEL_FINISHED;
if (c->close)
CHANNEL_CLOSE(c);
status |= CHANNEL_CLOSE(c);
dealloc_channel(table, channel);
/* If this was the last channel, close connection */
if (table->pending_close && !table->next_channel)
status |= LSH_CLOSE;
}
if (status & LSH_CHANNEL_PENDING_CLOSE)
table->pending_close = 1;
/* If this was the last channel, close connection */
if (table->pending_close && !table->next_channel)
status |= LSH_CLOSE;
return status;
}
......
......@@ -99,11 +99,10 @@
; Called when the channel is closed
; FIXME: Is this needed for anything?
(close method void)
(close method int)
; Called when eof is received on the channel (or when it is
; closed, whatever happens first).
(eof method int)
; Reply from SSH_MSG_CHANNEL_OPEN_REQUEST
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment