Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL "freezes" in Windows when drag scrollbar in console window #322

Closed
z0hm opened this issue Jun 23, 2015 · 6 comments
Closed

cURL "freezes" in Windows when drag scrollbar in console window #322

z0hm opened this issue Jun 23, 2015 · 6 comments

Comments

@z0hm
Copy link

z0hm commented Jun 23, 2015

WinXPSP2 x32, curl 7.42.1.
Old bug. Open console - run cmd.exe, run curl.exe URL for download - if you pull the scrollbar, then curl freezes, traffic is interrupted, and then disconnects, if you hold for a while scrollbar to view the output in the console.

@bagder
Copy link
Member

bagder commented Jun 23, 2015

What does it do exactly to make curl fail? Does it prevent/pause the writing to stdout? Isn't this a bug in Windows rather than in curl?

@z0hm
Copy link
Author

z0hm commented Jun 23, 2015

I don't know. But this may not be a bug in the implementation of output to the console in CURL for Windows?
Piccy.info - Free Image Hosting

@jay
Copy link
Member

jay commented Jun 23, 2015

Windows console IO is blocking as far as I know though I recall there may be some workaround for reading. WriteConsole is unable to write to the console while you have mousedown on the scrollbar or are selecting text or have selected text but not yet copied it. It's not specifically documented that way from what I see but that's the way it has behaved forever. It should be considered expected behavior in Windows for any program that outputs to the console and should not be considered a bug in curl.

@jay jay closed this as completed Jun 23, 2015
@z0hm
Copy link
Author

z0hm commented Jun 23, 2015

But why not make a workaround - stop the output in the console , so that traffic is not interrupted ? the user uses a scrollbar to see the old records in the console. And after the user releases the scrollbar to bring the latest information ( progress ) .

@jay
Copy link
Member

jay commented Jun 24, 2015

If we are able in some reliable way to check the console to see if it's ok to write before writing there's still the possibility that when WriteConsole is called the status may have changed by then. So though we could skip a WriteConsole call that by itself wouldn't solve the issue unless we call WriteConsole (or whatever is calling it like fprintf) in a separate thread.

It's conceivable we could do some limited version of what you are suggesting by writing some of the progress output to stderr from a separate thread. That's not a catch all but it would help at least. I'm not sure if it's worth the time though. I've reopened this as an enhancement, let's see if anyone else has an opinion.

@jay jay reopened this Jun 24, 2015
@jay jay changed the title cURL "freezes" when drag scrollbar in console window cURL in Windows "freezes" when drag scrollbar in console window Jun 28, 2015
@jay jay changed the title cURL in Windows "freezes" when drag scrollbar in console window cURL "freezes" in Windows when drag scrollbar in console window Jun 28, 2015
@bagder bagder closed this as completed in 14b9e78 Jul 25, 2015
@gvanem
Copy link
Contributor

gvanem commented Jul 26, 2015

But why not make a workaround - stop the output in the console , so that traffic is not interrupted ?

Isn't the current process (i.e. curl) suspended when you drag the scrollbar? (Check with WinDbg, Process Explorer for example). Hence it would be nearly impossible for curl to stop the output in the console.

jgsogo pushed a commit to jgsogo/curl that referenced this issue Oct 19, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants