W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1999

Re: When can you call HTHost_killPipe?

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 22 Jun 1999 14:55:00 -0400
To: www-lib@w3.org
Message-ID: <376FDC04.3DB7D6B0@w3.org>
To: Michael Saunders <michael@amtec.com>
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.

In the progress dialog callback? You mean when it says that "40% read"?
Hmm, there is no guarantee that these are called in reentrant places -
you need to call them from a event handler [1] - this is for example
what the tiny browser does (although it quites the application).

> 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?

If you kill a pipeline from an event handler then it should work better
than this.


[1] http://www.w3.org/Library/src/HTEvent.html

Henrik Frystyk Nielsen, <frystyk@w3.org>
World Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA
Received on Tuesday, 22 June 1999 14:55:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:49 UTC