Commit 6752c203 authored by Niels Möller's avatar Niels Möller
Browse files

* src/client.c (do_send_first): Removed this function.

(do_client_io): Fixed setup of fd:s, and their close-callbacks and
exception handlers. Also register the fd:s on the channel's
resources list.

Rev: src/client.c:1.77
parent 5b369094
......@@ -361,6 +361,7 @@ do_send(struct ssh_channel *s,
self->in->super.want_read = 1;
#if 0
/* Used for the first callback, to register stdin as a resource. */
static void
do_send_first(struct ssh_channel *s,
......@@ -368,11 +369,12 @@ do_send_first(struct ssh_channel *s,
CAST(client_session, self, s);
REMEMBER_RESOURCE(connection->resources, &self->in->super.super);
REMEMBER_RESOURCE(channel->resources, &self->in->super.super);
s->send = do_send;
do_send(s, connection);
/* We have a remote shell */
static void
......@@ -386,21 +388,37 @@ do_client_io(struct command *s UNUSED,
struct ssh_channel *channel = &session->super;
channel->receive = do_receive;
= session->err->super.close_callback
= make_channel_close_callback(channel);
/* Set up write fd:s. */
session->in-> = make_channel_read_data(channel);
channel->receive = do_receive;
#if 0
/* FIXME: It seems a little kludgy to modify
* exception handlers here; it would be better to create the
* fd-objects at a point where the right exception handlers can be
* installed from the start. */
= make_channel_io_exception_handler(channel,
"lsh: I/O error on stdout",
= make_channel_io_exception_handler(channel,
"lsh: I/O error on stderr",
/* Set up the fd we read from. */
channel->send = do_send;
session->in-> = make_channel_read_data(channel);
= make_channel_read_close_callback(channel);
channel->send = do_send_first;
/* Make sure stdio is closed properly if the channel or connection dies */
REMEMBER_RESOURCE(channel->resources, &session->in->super.super);
REMEMBER_RESOURCE(channel->resources, &session->out->super.super);
REMEMBER_RESOURCE(channel->resources, &session->err->super.super);
ALIST_SET(channel->request_types, ATOM_EXIT_STATUS,
ALIST_SET(channel->request_types, ATOM_EXIT_SIGNAL,
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