diff options
author | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2015-02-17 11:30:28 +0900 |
---|---|---|
committer | Julien Gilli <julien.gilli@joyent.com> | 2015-06-17 12:55:20 -0700 |
commit | 9463cfae333a5c249e26aef4e5607cbe1d84dea5 (patch) | |
tree | 95ea32c045b6223c09cb2ea4a57cda71ade97b39 | |
parent | 81e30a11ba79fc5b7d77041956439e760669f9c4 (diff) | |
download | nodejs-9463cfae333a5c249e26aef4e5607cbe1d84dea5.tar.gz nodejs-9463cfae333a5c249e26aef4e5607cbe1d84dea5.tar.bz2 nodejs-9463cfae333a5c249e26aef4e5607cbe1d84dea5.zip |
openssl: fix keypress requirement in apps on win32
reapply b910613792dac946b295855963869933a9089044
PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR: #25523
PR-URL: https://github.com/joyent/node/pull/25523
Reviewed-By: Julien Gilli <jgilli@fastmail.fm>
-rw-r--r-- | deps/openssl/openssl/apps/s_client.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index 28737b6d1..c2e6c0bfd 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -180,6 +180,13 @@ typedef unsigned int u_int; # include <fcntl.h> #endif +/* Use Windows API with STD_INPUT_HANDLE when checking for input? + Don't look at OPENSSL_SYS_MSDOS for this, since it is always defined if + OPENSSL_SYS_WINDOWS is defined */ +#if defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_WINCE) && defined(STD_INPUT_HANDLE) +#define OPENSSL_USE_STD_INPUT_HANDLE +#endif + #undef PROG #define PROG s_client_main @@ -1584,10 +1591,7 @@ int MAIN(int argc, char **argv) tv.tv_usec = 0; i = select(width, (void *)&readfds, (void *)&writefds, NULL, &tv); -# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS) - if (!i && (!_kbhit() || !read_tty)) - continue; -# else +#if defined(OPENSSL_USE_STD_INPUT_HANDLE) if (!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle @@ -1595,6 +1599,8 @@ int MAIN(int argc, char **argv) 0))) || !read_tty)) continue; +#else + if(!i && (!_kbhit() || !read_tty) ) continue; # endif } else i = select(width, (void *)&readfds, (void *)&writefds, @@ -1793,12 +1799,12 @@ int MAIN(int argc, char **argv) } } #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS) - else if (_kbhit()) -# else +#if defined(OPENSSL_USE_STD_INPUT_HANDLE) else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) +#else + else if (_kbhit()) # endif #elif defined (OPENSSL_SYS_NETWARE) else if (_kbhit()) |