Hello Francois and everyone else,

We have touched this subject before but the thread never got finished so I'm
afraid it got lost between all of the other postings. I hope you don't mind
that I start this topic in a new thread so I can focus on this single
problem instead of the getting lost in the other questions I asked in the
previous thread.

To summarize : the problem I'm having is that I cannot detect that a 'stream
write error' (e.g. due to insufficient disc space) has been encountered
while saving the data that has been downloaded to HttpCli->RcvdStream (which
has been assigned a TFileStream).

In response to my question earlier you said :
> You should be able to catch it by assigning an event handler to
> THttpCli.CtrlSocket.OnBgException.
> Ideally I should expose this OnBgException in THttpCli.

Unfortunately, it seems that this exception is not exposed via
THttpCli.CtrlSocket.OnBgException making it impossible for me to write a
reliable download-module for my application. When an error occurs druing the
TFileStream write I have no way to detect this which causes my application
to report that the file was successfully downloaded even though it has only
been partially saved (and therefore the resulting file is corrupt).

Any help on this is very much appreciated. I've had a look myself at your
ICS source code about resolving this issue myself but I don't have
sufficient knowledge to make this work.

Just to make sure that it isn't a problem in my code I have pasted a very
short relevant piece of my source code :

HttpCli->RcvdStream=new TFileStream(File,fmCreate);
void __fastcall HttpComponent::HttpException
 (TObject *Sender, Exception *E, bool &CanClose)
 DebugText("Exception occurred...");
Then I trigger an error situation by saving the received http data to a
TFileStream located on an USB memory stick which has insufficient free
space. This will trigger an exception in procedure TStream.WriteBuffer :
'Stream write error' which is located in '...\Win32\rtl\common\classes.pas'.

Unfortunately, the exception does not cause the handler defined in
HttpCli->CtrlSocket->OnBgException to be called making it impossible for me
to detect the problem.



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

Reply via email to