This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin at cygwin dot com
- Date: Thu, 5 Mar 2015 20:24:56 +0900
- Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
- Authentication-results: sourceware.org; auth=none
- References: <20150228144019 dot 0e4cfdb3a26bfac361b538e2 at nifty dot ne dot jp> <20150228140251 dot GA11124 at calimero dot vinschen dot de> <20150302204502 dot 39b3e03ad5084b0b5add5d10 at nifty dot ne dot jp> <20150302144426 dot GK3213 at calimero dot vinschen dot de> <20150304203407 dot 14008531b0fb63ad5c19a33f at nifty dot ne dot jp> <20150304121952 dot GL3213 at calimero dot vinschen dot de> <20150304181857 dot GM3213 at calimero dot vinschen dot de>
On Wed, 4 Mar 2015 19:18:57 +0100
Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> The result is the patch I attached to this mail. I'm not sure it's the
> most feasible way to solve this problem, but it works pretty nicely for
> me, including pasting big chunks (I tried a clipboard with about 70K
> of data) while yes(1) is running.
Thank you, Corinna.
I have tried your patch. It nicely works for me, too.
And your workaround is definitely better than mine.
One small thing to be improved is here:
+ if (echo_cnt > 0
+ && ReadFile (echo_r, outbuf, MIN (rlen, echo_cnt), &n, NULL))
echo_cnt returned by ::bytes_available() is actually
not a number of bytes available in the pipe. This is
because ::bytes_available() returns "nleft" instead
of "navail" when "nleft" is non-zero.
Therefore, "rlen" should be used here rather than
"MIN (rlen, echo_cnt)".
By the way, should we go to cygwin-developer mailing list?
--
Takashi Yano <takashi.yano@nifty.ne.jp>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple