San Mehat | a430b2b | 2014-09-23 08:30:51 -0700 | [diff] [blame] | 1 | diff -Naur stunnel.orig/src/client.c stunnel/src/client.c |
| 2 | --- stunnel.orig/src/client.c 2010-04-04 17:00:29.000000000 -0400 |
| 3 | +++ stunnel/src/client.c 2010-04-12 17:12:47.000000000 -0400 |
| 4 | @@ -187,6 +187,7 @@ |
| 5 | enter_critical_section(CRIT_CLIENTS); /* for multi-cpu machines */ |
| 6 | s_log(LOG_DEBUG, "Service %s finished (%d left)", c->opt->servname, |
| 7 | --num_clients); |
| 8 | + if (getenv("STUNNEL_ONCE")) {fprintf(stderr, "stunnel: exiting.\n"); exit(0);} |
| 9 | leave_critical_section(CRIT_CLIENTS); |
| 10 | #endif |
| 11 | } |
| 12 | diff -Naur stunnel.orig/src/network.c stunnel/src/network.c |
| 13 | --- stunnel.orig/src/network.c 2010-02-04 05:31:45.000000000 -0500 |
| 14 | +++ stunnel/src/network.c 2010-04-12 17:13:53.000000000 -0400 |
| 15 | @@ -437,6 +437,7 @@ |
| 16 | if((pid=wait(&status))>0) { |
| 17 | --num_clients; /* one client less */ |
| 18 | #endif |
| 19 | + if (getenv("STUNNEL_ONCE")) exit(0); |
| 20 | #ifdef WIFSIGNALED |
| 21 | if(WIFSIGNALED(status)) { |
| 22 | s_log(LOG_DEBUG, "Process %d terminated on signal %d (%d left)", |
| 23 | diff -Naur stunnel.orig/src/options.c stunnel/src/options.c |
| 24 | --- stunnel.orig/src/options.c 2010-04-05 14:44:43.000000000 -0400 |
| 25 | +++ stunnel/src/options.c 2010-04-12 17:19:18.000000000 -0400 |
| 26 | @@ -470,6 +470,7 @@ |
| 27 | switch(cmd) { |
| 28 | case CMD_INIT: |
| 29 | new_global_options.option.syslog=1; |
| 30 | + if (getenv("STUNNEL_NO_SYSLOG")) new_global_options.option.syslog=0; |
| 31 | break; |
| 32 | case CMD_EXEC: |
| 33 | if(strcasecmp(opt, "syslog")) |
| 34 | diff -Naur stunnel.orig/src/stunnel.c stunnel/src/stunnel.c |
| 35 | --- stunnel.orig/src/stunnel.c 2010-02-25 04:57:11.000000000 -0500 |
| 36 | +++ stunnel/src/stunnel.c 2010-04-12 17:16:33.000000000 -0400 |
| 37 | @@ -306,6 +306,7 @@ |
| 38 | max_clients=0; |
| 39 | s_log(LOG_NOTICE, "No limit detected for the number of clients"); |
| 40 | } |
| 41 | + if (getenv("STUNNEL_MAX_CLIENTS")) max_clients = atoi(getenv("STUNNEL_MAX_CLIENTS")); |
| 42 | } |
| 43 | |
| 44 | #ifdef HAVE_CHROOT |