summaryrefslogtreecommitdiffstats
path: root/x11vnc/sslcmds.c
diff options
context:
space:
mode:
authorrunge <runge>2006-03-05 00:35:33 +0000
committerrunge <runge>2006-03-05 00:35:33 +0000
commita9a9c812f7feb5bfb1d017575762c6a6390227b9 (patch)
tree1f1e013d1c905b0e705ec245aa9fec1df6cb1c30 /x11vnc/sslcmds.c
parentb03a920cb996bf61af2d9351d2fe497ea3c0c99e (diff)
downloadlibtdevnc-a9a9c812f7feb5bfb1d017575762c6a6390227b9.tar.gz
libtdevnc-a9a9c812f7feb5bfb1d017575762c6a6390227b9.zip
x11vnc: -unixpw on *bsd, hpux and tru64. -unixpw_nis mode. stunnel and gui tweaks.
Diffstat (limited to 'x11vnc/sslcmds.c')
-rw-r--r--x11vnc/sslcmds.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/x11vnc/sslcmds.c b/x11vnc/sslcmds.c
index c1dfa92..48340de 100644
--- a/x11vnc/sslcmds.c
+++ b/x11vnc/sslcmds.c
@@ -19,6 +19,27 @@ void setup_stunnel(int rport, int *argc, char **argv);
static pid_t stunnel_pid = 0;
+void check_stunnel(void) {
+ static time_t last_check = 0;
+ time_t now = time(0);
+
+ if (last_check + 3 >= now) {
+ return;
+ }
+ last_check = now;
+
+ if (stunnel_pid > 0) {
+ int status;
+ waitpid(stunnel_pid, &status, WNOHANG);
+ if (kill(stunnel_pid, 0) != 0) {
+ waitpid(stunnel_pid, &status, WNOHANG);
+ rfbLog("stunnel subprocess %d died.\n", stunnel_pid);
+ stunnel_pid = 0;
+ clean_up_exit(1);
+ }
+ }
+}
+
int start_stunnel(int stunnel_port, int x11vnc_port) {
#ifdef SSLCMDS
char extra[] = ":/usr/sbin:/usr/local/sbin";