summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2015-02-17 11:30:28 +0900
committerMyles Borins <mylesborins@google.com>2018-03-27 20:18:35 -0400
commit6fd2cc93a651caa31ec82b9999fbacac605c3fbd (patch)
treeb78fefa77779b2f996b04942fc4656fb76331ee4
parent5108108606c4c76e01292cc0849250fcd8677a0f (diff)
downloadnode-new-6fd2cc93a651caa31ec82b9999fbacac605c3fbd.tar.gz
openssl: fix keypress requirement in apps on win32
Reapply b910613792dac946b295855963869933a9089044 . Backport-PR-URL: https://github.com/nodejs/node/pull/19638 Fixes: https://github.com/iojs/io.js/issues/589 PR-URL: https://github.com/iojs/io.js/pull/1389 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
-rw-r--r--deps/openssl/openssl/apps/s_client.c20
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 c85566855f..fbf5899e4b 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
@@ -1793,10 +1800,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
@@ -1804,6 +1808,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,
@@ -2005,12 +2011,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())