Small fix to enable reading from stdin as well.
authorRichard Levitte <levitte@openssl.org>
Thu, 1 Jun 2000 11:23:20 +0000 (11:23 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 1 Jun 2000 11:23:20 +0000 (11:23 +0000)
Contributed by Yoichiro Okabe <okabe@wizsoft.co.jp>

apps/s_client.c

index e629f8e7f13f6a5c2e03c3bc70ace073d782d65f..277417efd8ae72bfd7aaa19b4cf405c6ee196c7e 100644 (file)
@@ -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