From: Richard Levitte Date: Thu, 1 Jun 2000 11:23:20 +0000 (+0000) Subject: Small fix to enable reading from stdin as well. X-Git-Tag: OpenSSL-engine-0_9_6-beta1~66^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a9ef75c50d35afc115d443ddc7dd35956fc5a2ef;p=oweals%2Fopenssl.git Small fix to enable reading from stdin as well. Contributed by Yoichiro Okabe --- diff --git a/apps/s_client.c b/apps/s_client.c index e629f8e7f1..277417efd8 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -523,7 +523,7 @@ re_start: tv.tv_usec = 0; i=select(width,(void *)&readfds,(void *)&writefds, NULL,&tv); - if(!i && (!_kbhit() || !read_tty) ) continue; + if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue; } else i=select(width,(void *)&readfds,(void *)&writefds, NULL,NULL); } @@ -689,7 +689,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 } #ifdef WINDOWS - else if (_kbhit()) + else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) #else else if (FD_ISSET(fileno(stdin),&readfds)) #endif