AW: AW: Solution for possible crash if using SSL

Hello Jose,

I did some further tests and now I use the following code (with less changes
than in my previous attempts):

PUBLIC int HTHost_forceFlush(HTHost * host)
{
    HTNet * targetNet = (HTNet *) HTList_lastObject(host->pipeline);
    int ret;
    if (targetNet == NULL) return HT_ERROR;
    if (host->in_flush) return HT_OK;
    HTTRACE(CORE_TRACE, "Host Event.. FLUSH passed to `%s\'\n" _
 
HTAnchor_physical(HTRequest_anchor(HTNet_request(targetNet))));
    host->forceWriteFlush = host->in_flush = YES;
    ret=(*targetNet->event.cbf)(HTChannel_socket(host->channel),
targetNet->event.param, HTEvent_FLUSH);
    host->forceWriteFlush = host->in_flush = NO;
    return ret;
}

It seems to work as well. The first request to HTHost_forceFlush comes IMHO
from HTSSLReader_read
(State SSL_ERROR_WANT_READ) in HTSSLReader.c. There is also a somewhat
strange (to me) comment
about a possible bug.
Sorry, but I don't have the time to evaluate the code in detail. I only want
my app to work ;)
Maybe someone can test this fix in a more complex app using different hosts
simultaneously.

Regards, Heiner

> -----Ursprüngliche Nachricht-----
> Von: jose.kahan@w3.org [mailto:jose.kahan@w3.org]
> Gesendet am: Freitag, 28. Juli 2000 10:42
> An: Kallweit, Heiner
> Cc: www-lib@w3.org
> Betreff: Re: AW: Solution for possible crash if using SSL
> 
> Hello Heiner,
> 
> Good work. I have just some final doubts before making the commit.
> 
> In HTHost_forceFlush() you return HT_ERROR if the in_flush 
> flag is set.
> The only place where this may make a problem is in HTTP.c:1192, where
> the return code is used to select the next HTTP automata state.
> 
> I'm not sure if we should return HT_ERROR or HT_OK or something else
> then if we catch the flag.
> 
> I looked again at your previous mail, where you give the 
> following stack:
> 
> >requests via Libwww and SSL. Every 100th request I got a core dump.
> >Eventually I found out that there is a recursive function 
> call. To cut a
> >long
> >story short: HTHost_forceFlush -> HTTPEvent_Flush ->
> >HTBufferWriter_lazyFlush
> >-> HTSSLWriter_write -> HTSSLReader_read -> HTHost_forceFlush
> 
> Do you remember where was the first HTHost_forceFlush called? 

Received on Friday, 28 July 2000 07:50:49 UTC