Re: When can you call HTHost_killPipe?

Michael Saunders wrote:
> 
> The documentation HTReq.html documentation indicates that if I want to kill all
> requests I MUST use HTHost_killPipe. Currently my application checks for detects
> that the user wants to cancel the request while in the progress dialog callback.
> When I issue the HTHost_killPipe from within that callback it causes a
> segmentation fault "HTReader.c":201 within the HTReader_read function after
> returning from the call to my progress dialog callback. It appears that I am not
> allowed to call HTHost_killPipe from my callback because it pulls the rug out
> from under the library.
> 
> My questions are:
> 
>         1) From which callbacks should I be calling HTHost_killPipe to cancel
>            a request that will not causing the library to perform a segmentation
>            fault? Timer callbacks, progress callbacks, error callbacks, etc?
> 
>         2) What steps should I perform to kill requests and still have the
>            library in a sane state for subsequent requests at a later time?
> 

Well, I tried adding just recording the fact that the user wants to cancel a
request from within the progress callback and then I have a HTTimer wake up
and determine if a cancel is needed.

Using the timer mechanism to perform the kill pipe operation does not cause the
rug to be pulled out from under the library (like it did when I called killed
the pipe from the progress callback) however I still have a problem with
this procedure. If I use HTHost_killPipe (or HTNet_killAll outside the event
loop as Raffaele suggested) I am unable to process future requests with the
library. As soon as the library attempts to process my request the read stream
operation performs an error and the library performs a kill pipe operation and
issues a "Fatal Error: Data transfer interrupted" error message.

Are there any other calls that must be made to cleanup the library so it is
ready to be used again. None of the example applications seem to address this
issue. They either perform several requests and exit or they don't allow the
requests to be interrupted.

Thanks,
Michael

P.S. Just as a side comment, a very simple interactive X Windows and
Microsoft Windows example utility that creates a transfer dialog with
a progress slider and a cancel button would go a long way to showing
how to use many of the features of the library and how to integrate
a windowing system event loop with the library. Are there any plans
to do this (Henrik)? I realize the Amaya browser is available but that
is a big chunk to bite off for learning how to use the library.

Received on Wednesday, 9 June 1999 11:43:54 UTC