Crashing in HTMIME

Hi,

It is possible that debug stack of the request is used several times.
For example first time when 401 is returned by server, second time when 304 is
returned by server. 

For the 401 server response the stream stack is created and it contains a debug
stream gotten from request, headers are parsed and stack is freed (debug
file-ftream is freed also).

For 304 debug file-stream of the request is tried to be used again and
application dumps.

To avoid this I have changed the code to immediately return HT_OK after
flushing file if leave-open is set to YES. This stops coredumps but allows the
memory leaks. 

In HTFWrite.c:

PRIVATE int HTFWriter_free (HTStream * me)
{
    if (me) {
                if (me->leave_open != YES) {
                    if (STREAM_TRACE) HTTrace("HTFWriter_free: ~~~~~ Closing fp
= %d\n",         me->fp);
                    
                    
                    fclose(me->fp);
                }
                
                else {
                    
                    HTFWriter_flush(me) 
                    return HT_OK;           // HERE
            
            }
  
              ...        

I think that debug stream could be freed in HTRequest_delete.

Thanks,

Olga Antropova. 


----------------------------------
E-Mail: olga <olga@eai.com>
Date: 29-Jan-99
Time: 13:12:21

This message was sent by XFMail
----------------------------------

Received on Friday, 29 January 1999 14:29:21 UTC