> Here is how I handle events: > > Objective, to download several files, very similar to the Httpasy demo: > On GoButton.Click: HttpCli.GetASync > OnHeaderEnd: Check if the file to be downloaded is good. If not, ABORT. > OnRequestDone: If ABORT, then clear the file, if not store the downloaded > file. Then get the next file.
Ah ! That's better explanation. >From the OnHeaderEnd, set a flag to remember the file is not good and then use PostMessage with a cutom message. From the event handler, call Abort if OnRequestDone has not been called already. From the OnRequestDone event, check your flag to know if the file is OK or not and process accordingly. Ignore any error condition if the flag is set because Abort has been called. It is always better to use PostMessage to defer any processing out of any event handler. At the time an custom message is handled, the component is out of his own work. If you put the processing in the event handler and this processing involve the component itself, then it is likely you'll have problems because when the event handler is returns, the component continue what it has started and which maybe the wrong thing if you changed the instructions ! Of course it the processing doesnt' involve the component itself, there is no problem. > The problem is that IF the statuscode is 302 and I Abort, then I cannot > get > the next file because the component is busy. (httpDNSLookup). You can turn "followRelocation" to false and handle the relocation yourself if this problem still happend with the change I outlined above. > My question is: Is there a bug in the component, or is there a better > method of doing this? No bug that I'm aware. Follow the outline I gave above. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
