Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4caa012

Browse filesBrowse files
Shigeki OhtsuItalo A. Casas
authored andcommitted
openssl: fix keypress requirement in apps on win32
Reapply b910613 . Fixes: #589 PR-URL: #1389 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 06f87c3 commit 4caa012
Copy full SHA for 4caa012

File tree

Expand file treeCollapse file tree

1 file changed

+13
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-7
lines changed
Open diff view settings
Collapse file

‎deps/openssl/openssl/apps/s_client.c‎

Copy file name to clipboardExpand all lines: deps/openssl/openssl/apps/s_client.c
+13-7Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ typedef unsigned int u_int;
180180
# include <fcntl.h>
181181
#endif
182182

183+
/* Use Windows API with STD_INPUT_HANDLE when checking for input?
184+
Don't look at OPENSSL_SYS_MSDOS for this, since it is always defined if
185+
OPENSSL_SYS_WINDOWS is defined */
186+
#if defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_WINCE) && defined(STD_INPUT_HANDLE)
187+
#define OPENSSL_USE_STD_INPUT_HANDLE
188+
#endif
189+
183190
#undef PROG
184191
#define PROG s_client_main
185192

@@ -1790,17 +1797,16 @@ int MAIN(int argc, char **argv)
17901797
tv.tv_usec = 0;
17911798
i = select(width, (void *)&readfds, (void *)&writefds,
17921799
NULL, &tv);
1793-
# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1794-
if (!i && (!_kbhit() || !read_tty))
1795-
continue;
1796-
# else
1800+
#if defined(OPENSSL_USE_STD_INPUT_HANDLE)
17971801
if (!i && (!((_kbhit())
17981802
|| (WAIT_OBJECT_0 ==
17991803
WaitForSingleObject(GetStdHandle
18001804
(STD_INPUT_HANDLE),
18011805
0)))
18021806
|| !read_tty))
18031807
continue;
1808+
#else
1809+
if(!i && (!_kbhit() || !read_tty) ) continue;
18041810
# endif
18051811
} else
18061812
i = select(width, (void *)&readfds, (void *)&writefds,
@@ -2002,12 +2008,12 @@ int MAIN(int argc, char **argv)
20022008
}
20032009
}
20042010
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
2005-
# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
2006-
else if (_kbhit())
2007-
# else
2011+
#if defined(OPENSSL_USE_STD_INPUT_HANDLE)
20082012
else if ((_kbhit())
20092013
|| (WAIT_OBJECT_0 ==
20102014
WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
2015+
#else
2016+
else if (_kbhit())
20112017
# endif
20122018
#elif defined (OPENSSL_SYS_NETWARE)
20132019
else if (_kbhit())

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.