Thanks for looking at it Dave, it has me completely stumped, I always seem to find the cruelest limitations of a technology where there's no way out. I think the CFHTTP timeout is probably working as intended, so that if no reply at all is received then the timeout applies. The problem is that there's no way to tell CFHTTP when to stop after it does start receiving data AND there wasn't an error in the HTTP header.
It's pretty interesting to put the code snip on a server and watch CPU utilization in the Task Manager when it's run. CPU utilization starts rising pretty rapidly, it takes ten or fifteen seconds to get all the way to 100% and then it's just pegged there forever, which means I can't ever let my link checker run unattended, and nobody else who ever builds a link checker with ColdFusion can either. Sometimes CPU utilization rises and falls a few times, creating an upward sawtooth pattern before it reaches 100%. I've tried putting the CFHTTP in a CFLOOP inside a custom tag to use CFEXIT logic on it, trying to break out of the loop execution after a few seconds time, but that didn't work either. I could theoretically accomplish the goal by using CFEXECUTE to run Ping.exe, but then I'd have to parse the output to get the ping time and deal with every possible error message, ack. What do you think the chances are that MM would patch version 5.0 CFHTTP for me with a 'global timeout' to force CFHTTP to stop after X seconds, LOL? Other than that I'm at a loss for a fix to this problem unless somebody else has some brilliant ideas. Do you know how to report a bug to Macromedia? Their website discusses various levels of paid support, but I am not about to pay them for the privilege of informing them of a bug in their code. Regards, Karl S. At 06:59 AM 8/12/05, Dave wrote: >I'm not sure of any way you can control the internal workings of CFHTTP, >which is what you'd have to do to force it to stop. The timeout should >stop it, so it sounds like you've discovered a bug in CFHTTP that should >be reported to MM (or maybe it already has). My guess is that you need to >use some other technology that you COULD control the inner workings. I'm >a hardcore CF coder, so I wouldn't know, but hopefuly someone else on this >list can give us some insight. > >In any case, it's a very interesting find! > >Dave > >-----Original Message----- >From: Karl Simanonok [mailto:[EMAIL PROTECTED] >Sent: Friday, August 12, 2005 7:51 AM >To: CF-Talk >Subject: CFHTTP calling an infinte loop > > >Here's a fun little pickle to chew on. This URL, >http://www.indexsearch.co.uk/websearch/page+space+web+NASA/, seems to >output an infinite loop. Go ahead, try it! :) > >Hopefully such server screwups are fairly rare, but I am building a link >checker using CFHTTP to call a series of URLs and I just know that one day >my link checker is going to run into another infinite URL, so I am trying >to figure out how to get past the problem now using this URL. What seems >to happen is that CFHTTP just keeps trying and trying and trying to >capture all the output once it's started coming in, any CFHTTP TimeOut >that's set apparently no longer functions once the data has started coming >back without an error in the HTTP header; if the URL didn't respond at all >or responded with an error I could catch it in a CFTRY no problem (I'm >using CF5 but could go to MX6 if I really had to). What I'd like to do is >encapsulate the CFHTTP in some kind of wrapper code that would enforce a >timeout of three or four seconds and kill the CFHTTP processing once that >external timeout was reached, but so far no joy, once the CFHTTP is >running it is oblivious to anything but stopping CFSERVER.EXE. Help would >be greatly appreciated in making the following code work with this URL: > > <CFSET StartTime = GetTickCount()> > <CFSET TimeEnd = StartTime + 4000> <!-- I'd like to set a max time of > 4 seconds ---> > > <CFTRY> > > <CFHTTP > URL="http://www.indexsearch.co.uk/websearch/page+space+web+NASA/" > METHOD="GET" > ResolveURL="0" > TimeOut="2" > Redirect="NO" > ThrowOnError="YES"> > > <CFIF #Variables.TimeEnd# LESS THAN OR EQUAL TO #GetTickCount()#> > <CFTHROW MESSAGE = "#Variables.TimeEnd# WAS LESS THAN OR > EQUAL TO #GetTickCount()#"> > </CFIF> > > </CFHTTP> > > <CFSET Ping = GetTickCount() - StartTime> > > <CFCATCH TYPE="Any"> > <!--- > Note: none of these 'advanced' types will work when > substituted for "Any" above): > COM.Allaire.ColdFusion.HTTPCFHTTPRequestEntityTooLarge > COM.Allaire.ColdFusion.HTTPRequestURITooLarge > COM.Allaire.ColdFusion.Request.Timeout > COM.Allaire.ColdFusion.HTTPConnectionTimeout > COM.Allaire.ColdFusion.HTTPFileNotRenderable > COM.Allaire.ColdFusion.HTTPGatewayTimeout > COM.Allaire.ColdFusion.HTTPNotAcceptable > ---> > > An error occurred > > </CFCATCH> > > </CFTRY> > >Regards, > >Karl S. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.8/71 - Release Date: 8/12/05 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214839 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

