mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Read from pipe to allow client to confirm and socket be closed.
This commit is contained in:
parent
d51f075a4e
commit
2a2a9760ee
5
TODO
5
TODO
@ -78,8 +78,7 @@
|
|||||||
should not emulate it doing so
|
should not emulate it doing so
|
||||||
- status bar customisation variables, show-activity, show-last-window
|
- status bar customisation variables, show-activity, show-last-window
|
||||||
- show-options
|
- show-options
|
||||||
- let server die when last session does
|
|
||||||
- fix occasion start server problems
|
|
||||||
- key binding bug: random changes?
|
- key binding bug: random changes?
|
||||||
- test and fix wsvt25
|
- test and fix wsvt25
|
||||||
- activity/bell should be per-window not per-link
|
- activity/bell should be per-window not per-link?? what if it is cur win in
|
||||||
|
session not being watched?
|
||||||
|
12
server.c
12
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.59 2008-06-07 07:27:28 nicm Exp $ */
|
/* $Id: server.c,v 1.60 2008-06-07 07:33:03 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -80,11 +80,14 @@ server_start(const char *path)
|
|||||||
default:
|
default:
|
||||||
close(pair[1]);
|
close(pair[1]);
|
||||||
|
|
||||||
ch = 0;
|
ch = 0x00;
|
||||||
if (read(pair[0], &ch, 1) == 1 && ch == 0xff) {
|
if (read(pair[0], &ch, 1) == 1 && ch == 0xff) {
|
||||||
close(pair[0]);
|
close(pair[0]);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
ch = 0x00;
|
||||||
|
if (write(pair[1], &ch, 1) != 1)
|
||||||
|
fatal("write failed");
|
||||||
close(pair[0]);
|
close(pair[0]);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -147,8 +150,9 @@ server_start(const char *path)
|
|||||||
ch = 0xff;
|
ch = 0xff;
|
||||||
if (write(pair[1], &ch, 1) != 1)
|
if (write(pair[1], &ch, 1) != 1)
|
||||||
fatal("write failed");
|
fatal("write failed");
|
||||||
/* Don't close the socketpair fd on success. */
|
read(pair[1], &ch, 1); /* Ignore errors; just to wait before closing. */
|
||||||
|
close(pair[1]);
|
||||||
|
|
||||||
n = server_main(path, fd);
|
n = server_main(path, fd);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
xmalloc_report(getpid(), "server");
|
xmalloc_report(getpid(), "server");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user