Commit ce03a894 authored by Niels Möller's avatar Niels Möller

*** empty log message ***

Rev: ChangeLog:1.44
Rev: NEWS:1.13
Rev: doc/TODO:1.36
Rev: src/command.c:1.1
Rev: src/command.h:1.3
parent 995dcf19
Mon Mar 8 00:29:17 1999 Niels Mller <nisse@lysator.liu.se>
* src/command.c: New file.
* src/io.c (write_callback): Use the write_buffer_consume()
function.
* src/resource.c, src/resource.h, src/write_buffer.c,
src/write_buffer.h: Use struct lsh_queue.
* src/write_buffer.h (write_buffer->length): New instance
variable.
* src/write_buffer.c (write_buffer_consume): New function.
* src/queue.c, src/queue.h: New files. Generic doubly linked list.
Sun Mar 7 15:21:43 1999 Niels Mller <nisse@lysator.liu.se>
* src/werror.c (werror_decimal): Bug fix.
......
NEWS for the 1999-03-08 snapshot
No user visible changes. Added a instance variable to keep
track of the amount of buffered data in the write_buffer
objects (needed to fix the broken flow control).
Added a generic doubly linked list, currently used by the
write_buffer and resource_list classes, but which will be
needed for more things (see the CONTROL item on the TODO
list).
NEWS for the 1999-03-07 snapshot
Improved CFMAKERAW. Ugly fix for the UNIX98-style pty:s
......
......@@ -55,6 +55,7 @@ CONFIGURATION
Read configuration files. Better command line options.
LOGGING
Use syslog to log server startup, shutdown, and user authentication.
......@@ -144,6 +145,19 @@ CAST is probably not patent encumbered (Schneier doesn't mention patents);
check what RFC 2144 (CAST-128) says on this subject.
CONTROL
Continue on the cpmmand evaluation mechanism i command.h and
command.c. Write commands for opening connections, channels and
sending global requests and chanel requests. In short, for doing
everything that the client and server need to do.
To do this, we need a few queues for outstanding requests, which would
be in the channel (channel requests) and the channel_table objects
(global requests). Perhaps, this is also the right time to fix callout
support.
MISC
Try to find out why read() sometimes returns -1 and sets errno==EPIPE,
......
/* command.h
*
* $Id$ */
/* lsh, an implementation of the ssh protocol
*
* Copyright (C) 1998 Niels Möller
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "command.h"
/* CLASS:
(class
(name compose_continuation)
(super command_continuation)
(vars
(f object command)
(c object command_continuation)))
*/
static int do_continue_compose(struct command_continuation *c,
struct lsh_object *value)
{
CAST(compose_continuation, self, c);
return COMMAND_CALL(self->f, value, self->c);
}
static struct command_continuation *
make_compose_continuation(struct command *f, struct command_continuation *c)
{
NEW(compose_continuation, self);
self->f = f;
self->c = c;
return &self->super;
}
/* CLASS:
(class
(name command_compose)
(super command)
(vars
(arg object command)
(f object command)))
*/
int do_compose_call(struct command_continuation *c, lsh_object *value)
{
CAST(command_compose, self, c);
return COMMAND_CALL(self->arg,
make_compose_continuation(self->f, c));
}
/* command.h
*
* $id$ */
* $Id$ */
/* lsh, an implementation of the ssh protocol
*
......@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef LSH_COMMAND_H_INCLUDED
......@@ -26,6 +26,10 @@
#include "lsh_object.h"
#include "list.h"
#include <stdarg.h>
#include "command.h.x"
/* Continuation based command execution. A command can take one object
......@@ -46,7 +50,16 @@
"struct lsh_object *arg")))
*/
#define COMMAND_DO(f, c) ((f)->do((f), (c)))
#define COMMAND_RETURN(c, v) ((c)->c((c), (struct lsh_object *) (v)))
#define COMMAND_CALL(f, c) ((f)->do((f), (c)))
#define COMMAND_RETURN(c, v) ((c)->c((c), (struct lsh_object *) (v)))
/* (lambda (x) (f (g x))) */
struct command *command_compose(struct command *f, struct command *g);
/* (lambda (x) (and (f1 x) (f2 x) ...)) */
struct command *command_andl(struct object_list *args);
/* (lambda (x) (or (f1 x) (f2 x) ...)) */
struct command *command_orl(struct object_list *args);
#endif /* LSH_COMMAND_H_INCLUDED */
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