Re: [Bug in HTNet module ?]

I remember this story...

I encountered the same problem since I needed some statistics
from HTNet object in After filter callback. I wasn't able to get
it 'cause HTNet is deleted before the 'After' filter is called.

I modified HTNet.c to call free_net(net) after HTNet_executeAfterAll(request,
status);

function HTNet_delete()

    /* Remove object from the table of Net Objects */
    unregister_net(net);

    /* Call AFTER filters */
    HTNet_executeAfterAll(request, status);
 
    free_net(net);

This created another problem with redirection, so that Henrik
made 'undo' for these changes.

After that I found that changing HTNet.c free_net to

PRIVATE BOOL free_net (HTNet * net)
{
    HTTRACE(CORE_TRACE, 
       "Net Object.. Freeing object %p\n" _ net);
    if (net) {
/*
        This call leads to core dump in some cases (redirection)
        and is not needed ?!
        HTRequest_setNet(net->request, NULL);
*/

        HT_FREE(net);
        return YES;
    }
    return NO;
}

fixes core dump in case of redirection.

This change was never submitted. It works for me,
but it should be tested more carefully...

Does anyone can prove that
 
        HTRequest_setNet(net->request, NULL);

is not required in HTNet.c free_net().

Mikhail Grouchinski


AKhassaia@vet.com.au (Amir Khassaia) wrote:

> --------------------------------------------- 
>	Attachment:  
>	MIME Type: multipart/alternative 
> --------------------------------------------- 
Hi
I have noticed an inconsistency in the WWWlib 5.2.8 source:
In HTNet.c
function HTNet_delete ( )
it says that the After filters need to be called before the deletion of
the HTNet object (big comment below), but in fact the free(net) call is
before the After filter execution started by HTNet_executeAfterAll ( )

Here is the bit of the code from the function :

    /* Remove object from the table of Net Objects */
 unregister_net(net);
        free_net(net);

     /* Call AFTER filters */
 HTNet_executeAfterAll(request, status);  <= This needs to be moved
between unregister and free calls ?

 /*
 ** Truely delete the HTNet object. Thanks to Mikhail Grouchinski
 ** we now do this after having called the after filters so that
 ** these filters can use the information in the Net object
 */

 People agree with me ?


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

Received on Monday, 21 February 2000 12:03:57 UTC