summaryrefslogtreecommitdiffhomepage
path: root/session.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-14 23:06:01 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-14 23:06:01 +0800
commita1aa16152737421a236653242e76970d9d8c4f90 (patch)
tree3ab89af02120c78d6b68b27ee5ed9d2f75ccb17f /session.h
parent9a7972dcb8fffda8084c7ade32af4436aad39e81 (diff)
make signal flags volatile, simplify handling
Diffstat (limited to 'session.h')
-rw-r--r--session.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/session.h b/session.h
index 9a78ddb..01db2ca 100644
--- a/session.h
+++ b/session.h
@@ -40,9 +40,6 @@
#include "dbutil.h"
#include "netio.h"
-extern int sessinitdone; /* Is set to 0 somewhere */
-extern int exitflag;
-
void common_session_init(int sock_in, int sock_out);
void session_loop(void(*loophandler)()) ATTRIB_NORETURN;
void session_cleanup(void);
@@ -157,6 +154,7 @@ struct sshsession {
int signal_pipe[2]; /* stores endpoints of a self-pipe used for
race-free signal handling */
+ int channel_signal_pending; /* Flag set when the signal pipe is triggered */
m_list conn_pending;
@@ -203,7 +201,6 @@ struct sshsession {
unsigned int chansize; /* the number of Channel*s allocated for channels */
unsigned int chancount; /* the number of Channel*s in use */
const struct ChanType **chantypes; /* The valid channel types */
- int channel_signal_pending; /* Flag set by sigchld handler */
/* TCP priority level for the main "port 22" tcp socket */
enum dropbear_prio socket_prio;
@@ -216,6 +213,10 @@ struct sshsession {
* really belong here, but nowhere else fits nicely */
int allowprivport;
+ /* this is set when we get SIGINT or SIGTERM, the handler is in main.c */
+ volatile int exitflag;
+ /* set once the ses structure (and cli_ses/svr_ses) have been populated to their initial state */
+ int init_done;
};
struct serversession {
@@ -283,7 +284,7 @@ struct clientsession {
/* for escape char handling */
int last_char;
- int winchange; /* Set to 1 when a windowchange signal happens */
+ volatile int winchange; /* Set to 1 when a windowchange signal happens */
int lastauthtype; /* either AUTH_TYPE_PUBKEY or AUTH_TYPE_PASSWORD,
for the last type of auth we tried */