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

*** empty log message ***

Rev: src/client.c:1.97
Rev: src/client.h:1.32
Rev: src/connection_commands.c:1.31
Rev: src/connection_commands.h:1.14
Rev: src/proxy_userauth.c:1.5
Rev: src/server_session.c:1.49
Rev: src/server_userauth.c:1.29
Rev: src/sexp_commands.c:1.13
Rev: src/sexp_test.c:1.14
Rev: src/tcpforward.c:1.54
parent 57576bea
......@@ -191,7 +191,7 @@ do_client_session_eof(struct ssh_channel *c)
{
CAST(client_session, session, c);
close_fd(session->in, 0);
close_fd(session->in);
}
static void
......
......@@ -43,7 +43,7 @@ make_client_callback(struct io_backend *b,
struct packet_handler *kexinit_handler);
struct read_handler *make_client_read_line(struct ssh_connection *c);
struct close_callback *make_client_close_handler(void);
struct lsh_callback *make_client_close_handler(void);
struct packet_handler *
make_accept_service_handler(UINT32 service,
......
......@@ -49,24 +49,23 @@
/* GABA:
(class
(name connection_close_handler)
(super close_callback)
(super lsh_callback)
(vars
(connection object ssh_connection)))
*/
static void
connection_die(struct close_callback *c, int reason)
connection_die(struct lsh_callback *c)
{
CAST(connection_close_handler, closure, c);
verbose("Connection died, for reason %i.\n", reason);
if (reason != CLOSE_EOF)
werror("Connection died.\n");
verbose("Connection died.\n");
KILL_RESOURCE_LIST(closure->connection->resources);
}
struct close_callback *make_connection_close_handler(struct ssh_connection *c)
struct lsh_callback *
make_connection_close_handler(struct ssh_connection *c)
{
NEW(connection_close_handler, closure);
......
......@@ -67,7 +67,7 @@ make_handshake_info(UINT32 flags,
extern struct collect_info_1 handshake_command;
#define CONNECTION_HANDSHAKE (&handshake_command.super.super.super)
struct close_callback *make_connection_close_handler(struct ssh_connection *c);
struct lsh_callback *make_connection_close_handler(struct ssh_connection *c);
extern struct command_simple connection_remember;
#define CONNECTION_REMEMBER (&connection_remember.super.super)
......
......@@ -294,6 +294,8 @@ do_proxy_userauth_continuation(struct command_continuation *c,
self->connection->dispatch[i] = self->connection->ignore;
FORCE_APPLY(action, self->super.up, self->super.e);
/* FIXME: Possibly call connection_handle_pending(). */
}
static struct command_continuation *
......
......@@ -547,7 +547,7 @@ spawn_process(struct server_session *session,
HANDLER_CONTEXT);
/* Close callback for stderr and stdout */
struct close_callback *read_close_callback
struct lsh_callback *read_close_callback
= make_channel_read_close_callback(channel);
session->in
......
......@@ -142,6 +142,14 @@ do_userauth_continuation(struct command_continuation *s,
self->connection->dispatch[i] = self->connection->ignore;
COMMAND_RETURN(self->up, self->connection);
/* NOTE: It would be better to use a callout, so that we return back
* to the backend loop before starting to process new packets. It's
* not obvious that calling connection_handle_pending() here is
* safe.
*
* connection_handle_pending(self->connection);
*/
}
static struct command_continuation *
......@@ -275,6 +283,8 @@ do_exc_userauth_handler(struct exception_handler *s,
make_protocol_exception(SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
"Access denied"));
}
/* FIXME: Possibly call connection_handle_pending(). */
break;
}
case EXC_USERAUTH_SPECIAL:
......@@ -288,6 +298,7 @@ do_exc_userauth_handler(struct exception_handler *s,
* So we have to dup it, to make the gc happy. */
C_WRITE(self->connection, lsh_string_dup(e->reply));
/* FIXME: Possibly call connection_handle_pending(). */
break;
}
}
......
......@@ -208,7 +208,7 @@ do_read_sexp_continue(struct command_continuation *s,
struct lsh_object *a)
{
CAST(read_sexp_continuation, self, s);
close_fd_nicely(self->fd, 0);
close_fd_nicely(self->fd);
trace("do_read_sexp_continue\n");
......@@ -243,7 +243,7 @@ do_read_sexp_exception_handler(struct exception_handler *s,
{
CAST(read_sexp_exception_handler, self, s);
if (x->type & EXC_SEXP)
close_fd_nicely(self->fd, 0);
close_fd_nicely(self->fd);
EXCEPTION_RAISE(self->super.parent, x);
}
......
......@@ -57,7 +57,8 @@ STATIC_EXCEPTION_HANDLER(do_sexp_test_handler, NULL);
(style . int)))
*/
static int do_output_sexp(struct sexp_handler *h, struct sexp *e)
static int
do_output_sexp(struct sexp_handler *h, struct sexp *e)
{
CAST(output_sexp, closure, h);
A_WRITE(closure->write, sexp_format(e, closure->style, 0) );
......@@ -70,21 +71,18 @@ static int do_output_sexp(struct sexp_handler *h, struct sexp *e)
/* GABA:
(class
(name input_closed)
(super close_callback)
(super lsh_callback)
(vars
(status . "int *")
;; (status . "int *")
(output object write_buffer)))
*/
static int do_close(struct close_callback *c, int reason)
static void
do_close(struct lsh_callback *c)
{
CAST(input_closed, closure, c);
write_buffer_close(closure->output);
*closure->status = (reason == CLOSE_EOF) ? EXIT_SUCCESS : EXIT_FAILURE;
return 4711;
}
#define BLOCK_SIZE 2000
......@@ -109,8 +107,7 @@ int main(int argc UNUSED, char **argv UNUSED)
close->super.f = do_close;
close->output = write;
close->status = &status;
io_read(make_lsh_fd(backend, STDIN_FILENO, &handler),
make_buffered_read(BLOCK_SIZE,
make_read_sexp(&out->super, SEXP_TRANSPORT, 1)),
......
......@@ -551,7 +551,7 @@ do_tcpip_cancel_forward(struct global_request *s UNUSED,
assert(port->socket);
verbose("Cancelling a requested tcpip-forward.\n");
close_fd(port->socket, 0);
close_fd(port->socket);
port->socket = NULL;
COMMAND_RETURN(c, NULL);
......
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