curl-users
Re: about "-m" on windows systems
Date: Mon, 2 Feb 2004 20:19:49 +0100
"Roth, Kevin P." <KPRoth_at_MAPLLC.com> said:
> I don't possess the knowledge of how to actually code this, but has this
> approach been considered? Would it work, if someone with the right
> knowledge could find the time to code it up?
I think someone is confused (me or you). -m/--max-timeout is for
total transfer time and -c/--connect-timeout is for name resolution only AFAICS.
If '-c', yes libcurl could fork off gethostbyname() in a separate thread and
call WaitForSingleObject (.., timeout) on the thread handle. I did just this
for Wget; look at function run_with_timeout() in mswindows.c.
The '-m' option could be done by emulating SIGALRM using 'timeSetEvent()'
from winmm.lib (gettimeofday() already uses that if WITHOUT_MM_LIB
isn't defined). But alarmfunc() cannot longjmp out of the event-callback.
I'm not sure how siglongjmp() is different from longjmp() in this respect,
but I wonder how this is safe to do in any environment. Not to mention
it's not thread-safe to have only a single jmpbuf.
--gv
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-02-02