Commit 8f38a128 authored by Niels Möller's avatar Niels Möller

(handshake_command): Make the connection timeout

if handshake is not completed within 10 minutes.

Rev: src/handshake.c:1.7
parent 02fbe896
......@@ -295,6 +295,9 @@ make_handshake_info(UINT32 flags,
/* Buffer size when reading from the socket */
#define BUF_SIZE (1<<14)
/* Ten minutes */
#define HANDSHAKE_TIMEOUT 600
DEFINE_COMMAND4(handshake_command)
(struct lsh_object *a1,
struct lsh_object *a2,
......@@ -370,6 +373,11 @@ DEFINE_COMMAND4(handshake_command)
->write_buffer->super,
info->random);
/* Install timeout. */
connection_set_timeout(connection,
HANDSHAKE_TIMEOUT,
"Handshake timed out");
connection->versions[mode] = version;
connection->kexinits[mode] = MAKE_KEXINIT(init);
connection->dispatch[SSH_MSG_KEXINIT]
......
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