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

Made backend a local variable. Bugfixes.

Rev: src/lshd.c:1.15
parent c06b39b7
...@@ -45,11 +45,9 @@ ...@@ -45,11 +45,9 @@
#include "werror.h" #include "werror.h"
#include "xalloc.h" #include "xalloc.h"
/* Block size for stdout and stderr buffers */
#define BLOCK_SIZE 32768 #define BLOCK_SIZE 32768
/* Global variable */
struct io_backend backend;
void usage(void) NORETURN; void usage(void) NORETURN;
void usage(void) void usage(void)
...@@ -126,6 +124,9 @@ int main(int argc, char **argv) ...@@ -126,6 +124,9 @@ int main(int argc, char **argv)
struct sockaddr_in local; struct sockaddr_in local;
/* STATIC, because the object exists at gc time */
struct io_backend backend = { STATIC_HEADER };
struct lsh_string *random_seed; struct lsh_string *random_seed;
struct randomness *r; struct randomness *r;
struct diffie_hellman_method *dh; struct diffie_hellman_method *dh;
...@@ -172,6 +173,8 @@ int main(int argc, char **argv) ...@@ -172,6 +173,8 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
init_backend(&backend);
random_seed = ssh_format("%z", "foobar"); random_seed = ssh_format("%z", "foobar");
r = make_poor_random(&sha_algorithm, random_seed); r = make_poor_random(&sha_algorithm, random_seed);
...@@ -206,7 +209,7 @@ int main(int argc, char **argv) ...@@ -206,7 +209,7 @@ int main(int argc, char **argv)
if (!io_listen(&backend, &local, if (!io_listen(&backend, &local,
make_server_callback(&backend, make_server_callback(&backend,
"lsh - a free ssh", "lsh - a free ssh",
BLOCK_SIZE, SSH_MAX_PACKET,
r, make_kexinit, r, make_kexinit,
kexinit_handler))) kexinit_handler)))
{ {
......
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