stunnel 5.20 issue using "--with-threads=ucontext"

Hello. We recently upgraded from stunnel 5.10 to 5.20. We compile using "--with-threads=ucontext" and with this flag, compilation of 5.20 fails in two places. Both failures seem like minor oversights. Here is a proposed patch to fix the two failures. This patch is against 5.20, but I just checked the most recent 5.21b2 and it appears to require the same changes. Thanks! Michael diff -ru stunnel-5.20.orig/src/cron.c stunnel-5.20-ucontext-fix/src/cron.c --- stunnel-5.20.orig/src/cron.c 2015-07-16 15:55:52.214064748 -0700 +++ stunnel-5.20-ucontext-fix/src/cron.c 2015-07-16 16:15:56.593107354 -0700 @@ -47,7 +47,9 @@ #if defined(USE_PTHREAD) || defined(USE_WIN32) NOEXPORT void cron_worker(void); NOEXPORT void cron_dh_param(void); -#endif +#elif !defined(OPENSSL_NO_DH) +NOEXPORT void cron_dh_param(void); +#endif #if defined(USE_PTHREAD) diff -ru stunnel-5.20.orig/src/tls.c stunnel-5.20-ucontext-fix/src/tls.c --- stunnel-5.20.orig/src/tls.c 2015-07-16 15:55:52.180064660 -0700 +++ stunnel-5.20-ucontext-fix/src/tls.c 2015-07-16 15:56:30.520164252 -0700 @@ -110,7 +110,7 @@ if(ready_head) ready_head->tls=tls_data; else /* ucontext threads not initialized */ - global_tls=tls; + global_tls=tls_data; } TLS_DATA *tls_get() {

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 20.07.2015 21:24, Michael Gebis wrote:
We recently upgraded from stunnel 5.10 to 5.20. We compile using "--with-threads=ucontext" and with this flag, compilation of 5.20 fails in two places.
Thank you. There is one more change (not affecting compilation): diff --git a/src/sthreads.c b/src/sthreads.c index cc84155..5fecc3c 100644 - --- a/src/sthreads.c +++ b/src/sthreads.c @@ -114,6 +114,8 @@ int sthreads_init(void) { s_log(LOG_ERR, "Cannot create the listening context"); return 1; } + /* update tls for newly allocated ready_head */ + ui_tls=tls_alloc(NULL, ui_tls, "ui"); /* no need to initialize ucontext_t structure here it will be initialied with swapcontext() call */ return 0; Mike -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJVrsj6AAoJEC78f/DUFuAUR+UQALEwgGSbFL+gh+L169sLAUZB GqfP9iq2a3HQh9WAD8OFSoVKBSxUya6UidKr/OV6L+cAvKZNWeK+1zsGbSHMzU/P 62+sVXQR60y0noN3P8ISETjOcCXIY14WDuzx0ycpMYnTomOB4tIc6WvgWA3eqh3X 4NswBPj0cTLUWIN/Nfruc2Wov0p1mUZR5mK2pScXot1ccTQzhlO6z0Sz5dlg5BAT PQBcYxHNl6ESnBt1q3SyAvKPf1XOuFZwXMCXeb3zGD/F57mEFlJnKjXiAPMaq2gR EoVwKZgcYSkpF6pew7+i4f0f/KXnwmc4SblXwYlvSU/1sXHqB3F3kqWyjLVFlHl1 ooQQonV3BhlGIXNOVO0wbpNf1aCkkpicnLsnfx05olywfjMNySc4/NMo4cyIAJXg 8W3dI9UYBVgktyP7/hK3W4fKV5P3vweTo7blIpku+w3M6DjUtnoBV0DPJK3O8hlA 6237CH6uJogPSyNsL8Uf854V48gtu11UOqX9ZlBz67SEEc4Gtd8x/kBdwWDKtN06 +2SDJzrqXhA7MHpEbQbSY5MLUdJdKEJ4XXyCuRk9pAHUvPpcaScCIFizNbJuzMVi zCBxLfcS6dY7VQH8/Rly3Vl9mR77d6WtaYydaS4PluwcbKKPgHnr0cQjEaNBwkZB tpNjekAFRjL/7o7MILzv =aLyf -----END PGP SIGNATURE-----
participants (2)
-
Michael Gebis
-
Michal Trojnara