mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
nits
This commit is contained in:
parent
b2d1f4fa4c
commit
2542fa19f3
@ -369,9 +369,11 @@ static int _tmate_connect_to_proxy(const char *hostname, int port)
|
||||
if (connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
|
||||
tmate_fatal("Cannot connect to proxy at %s:%d", hostname, port);
|
||||
|
||||
{
|
||||
int flag = 1;
|
||||
if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(flag)) < 0)
|
||||
tmate_fatal("Can't set proxy socket to TCP_NODELAY");
|
||||
}
|
||||
|
||||
if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0)
|
||||
tmate_fatal("Can't set proxy socket to non-blocking");
|
||||
|
@ -212,7 +212,7 @@ static void create_session_ro_symlink(struct tmate_session *session)
|
||||
char *tmp, *token, *session_ro_path;
|
||||
|
||||
#ifdef DEVENV
|
||||
tmp = "READONLYTOKENFORDEVENV000";
|
||||
tmp = xstrdup("READONLYTOKENFORDEVENV000");
|
||||
#else
|
||||
tmp = get_random_token();
|
||||
#endif
|
||||
@ -363,9 +363,10 @@ static void tmate_spawn_slave_daemon(struct tmate_session *session)
|
||||
struct tmate_ssh_client *client = &session->ssh_client;
|
||||
char *token;
|
||||
|
||||
token = get_random_token();
|
||||
#ifdef DEVENV
|
||||
strcpy(token, "SUPERSECURETOKENFORDEVENV");
|
||||
token = xstrdup("SUPERSECURETOKENFORDEVENV");
|
||||
#else
|
||||
token = get_random_token();
|
||||
#endif
|
||||
|
||||
set_session_token(session, token);
|
||||
|
@ -101,7 +101,11 @@ static ssh_channel channel_open_request_cb(ssh_session session, void *userdata)
|
||||
}
|
||||
|
||||
if (client->channel) {
|
||||
/* We already have a channel, returning NULL means we are unhappy */
|
||||
/*
|
||||
* We already have a channel, and we don't support multi
|
||||
* channels yet. Returning NULL means the channel request will
|
||||
* be denied.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -188,9 +192,11 @@ static void client_bootstrap(struct tmate_session *_session)
|
||||
/* new process group, we don't want to die with our parent (upstart) */
|
||||
setpgid(0, 0);
|
||||
|
||||
{
|
||||
int flag = 1;
|
||||
setsockopt(ssh_get_fd(session), IPPROTO_TCP, TCP_NODELAY,
|
||||
&flag, sizeof(flag));
|
||||
}
|
||||
|
||||
signal(SIGALRM, handle_sigalrm);
|
||||
alarm(grace_period);
|
||||
|
5
tmate.h
5
tmate.h
@ -254,11 +254,6 @@ static inline bool tmate_has_proxy(void)
|
||||
return !!tmate_settings->proxy_hostname;
|
||||
}
|
||||
|
||||
|
||||
extern void timespec_subtract(struct timespec *result,
|
||||
struct timespec *x, struct timespec *y);
|
||||
extern unsigned long long timespec_to_millisec(struct timespec *ts);
|
||||
|
||||
/* tmate-debug.c */
|
||||
|
||||
extern void tmate_preload_trace_lib(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user