Commit 89b19768 authored by Niels Möller's avatar Niels Möller
Browse files

Replaced io_fd with lsh_fd.

Rev: src/lsh.c:1.97
Rev: src/lsh_proxy.c:1.4
Rev: src/sexp_commands.c:1.7
Rev: src/sexp_conv.c:1.12
Rev: src/tcpforward.c:1.37
Rev: src/tcpforward.h:1.12
parent 12d5b37c
......@@ -195,7 +195,7 @@ do_options2known_hosts(struct command *ignored UNUSED,
struct lsh_string *tmp = NULL;
const char *s = NULL;
struct io_fd *f;
struct lsh_fd *f;
if (options->known_hosts)
s = options->known_hosts;
......@@ -236,7 +236,7 @@ do_options2identities(struct command *ignored UNUSED,
struct lsh_string *tmp = NULL;
const char *s = NULL;
struct io_fd *f = NULL;
struct lsh_fd *f = NULL;
trace("do_options2identities\n");
......@@ -731,14 +731,15 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
}
if (s)
{
struct io_fd *f
struct lsh_fd *f
= io_write_file(self->backend, s,
O_CREAT | O_APPEND | O_WRONLY,
0600, 500, NULL,
make_report_exception_handler(EXC_IO, EXC_IO,
"Writing new ACL: ",
&default_exception_handler,
HANDLER_CONTEXT));
make_report_exception_handler
(make_report_exception_info(EXC_IO, EXC_IO,
"Writing new ACL: "),
&default_exception_handler,
HANDLER_CONTEXT));
if (f)
self->capture_file = &f->write_buffer->super;
else
......@@ -817,11 +818,11 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
(&self->actions,
make_start_session
(make_open_session_command(make_client_session
(io_read(make_io_fd(self->backend, in, self->handler),
(io_read(make_lsh_fd(self->backend, in, self->handler),
NULL, NULL),
io_write(make_io_fd(self->backend, out, self->handler),
io_write(make_lsh_fd(self->backend, out, self->handler),
BLOCK_SIZE, NULL),
io_write(make_io_fd(self->backend, err, self->handler),
io_write(make_lsh_fd(self->backend, err, self->handler),
BLOCK_SIZE, NULL),
WINDOW_SIZE,
self->exit_code)),
......@@ -994,12 +995,8 @@ do_lsh_default_handler(struct exception_handler *s,
case EXC_SEXP_SYNTAX:
case EXC_SPKI_TYPE:
case EXC_CHANNEL_REQUEST:
/* FIXME: There's no handler specifically for CHANNEL_OPEN
* failures for locally forwarded ports. That means that if a
* locally forwarded connection failes, lsh will exit (at some
* later time) with a non-zero exit status. */
case EXC_CHANNEL_OPEN:
werror("lsh: %z\n", e->msg);
*self->status = EXIT_FAILURE;
break;
......
......@@ -179,7 +179,7 @@ do_options2keyfile(struct command *ignored UNUSED,
{
CAST(lsh_proxy_options, options, a);
struct io_fd *f;
struct lsh_fd *f;
f = io_read_file(options->backend, options->hostkey, e);
......@@ -581,9 +581,10 @@ int main(int argc, char **argv)
COMMAND_CALL(server_listen, options,
&discard_continuation,
make_report_exception_handler(EXC_IO, EXC_IO, "lsh_proxy: ",
&default_exception_handler,
HANDLER_CONTEXT));
make_report_exception_handler
(make_report_exception_info(EXC_IO, EXC_IO, "lsh_proxy: "),
&default_exception_handler,
HANDLER_CONTEXT));
}
}
......
......@@ -26,6 +26,7 @@
#include "sexp_commands.h"
#include "format.h"
#include "io.h"
#include "werror.h"
#include "xalloc.h"
......@@ -215,14 +216,14 @@ do_read_sexp_continue(struct command_continuation *s,
}
static struct command_continuation*
make_read_sexp_continuation(struct io_fd *fd,
make_read_sexp_continuation(struct lsh_fd *fd,
struct command_continuation *up)
{
NEW(read_sexp_continuation, self);
trace("make_read_sexp_continuation\n");
self->super.c =do_read_sexp_continue;
self->fd = &fd->super;
self->fd = fd;
self->up = up;
return &self->super;
......@@ -248,7 +249,7 @@ do_read_sexp_exception_handler(struct exception_handler *s,
}
static struct exception_handler *
make_read_sexp_exception_handler(struct io_fd *fd,
make_read_sexp_exception_handler(struct lsh_fd *fd,
struct exception_handler *e,
const char *context)
{
......@@ -260,7 +261,7 @@ make_read_sexp_exception_handler(struct io_fd *fd,
self->super.parent = e;
self->super.context = context;
self->fd = &fd->super;
self->fd = fd;
return &self->super;
}
......@@ -274,7 +275,7 @@ do_read_sexp(struct command *s,
struct exception_handler *e)
{
CAST(read_sexp_command, self, s);
CAST_SUBTYPE(io_fd, fd, a);
CAST_SUBTYPE(lsh_fd, fd, a);
trace("do_read_sexp\n");
......
......@@ -251,14 +251,14 @@ int main(int argc, char **argv)
make_read_sexp_command(options->input, !options->once),
options->transform,
options->print,
&(io_write(make_io_fd(backend,
&(io_write(make_lsh_fd(backend,
STDOUT_FILENO,
e),
SEXP_BUFFER_SIZE,
NULL)
->write_buffer->super)));
struct io_fd *in = make_io_fd(backend, STDIN_FILENO, e);
struct lsh_fd *in = make_lsh_fd(backend, STDIN_FILENO, e);
/* Fixing the exception handler creates a circularity */
e->parent = make_exc_finish_read_handler(&in->super,
......
......@@ -109,7 +109,7 @@ remove_forward(struct object_queue *q, int null_ok,
(name tcpip_channel)
(super ssh_channel)
(vars
(socket object io_fd)))
(socket object lsh_fd)))
*/
static void
......@@ -138,7 +138,7 @@ do_tcpip_send(struct ssh_channel *s,
{
CAST(tcpip_channel, self, s);
self->socket->super.want_read = 1;
self->socket->want_read = 1;
}
static void
......@@ -155,10 +155,11 @@ do_tcpip_channel_die(struct ssh_channel *c)
CAST(tcpip_channel, channel, c);
if (channel->socket)
close_fd(&channel->socket->super, 0);
close_fd(channel->socket, 0);
}
struct ssh_channel *make_tcpip_channel(struct io_fd *socket, UINT32 max_window)
struct ssh_channel *
make_tcpip_channel(struct lsh_fd *socket, UINT32 max_window)
{
NEW(tcpip_channel, self);
assert(socket);
......
......@@ -74,7 +74,7 @@ struct remote_port *
make_remote_port(struct address_info *listen,
struct command *callback);
struct ssh_channel *make_tcpip_channel(struct io_fd *socket, UINT32 max_window);
struct ssh_channel *make_tcpip_channel(struct lsh_fd *socket, UINT32 max_window);
void tcpip_channel_start_io(struct ssh_channel *c);
struct channel_open *
......
Markdown is supported
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