Re: Possible bug inside HTProfile_delete() after FTP download?

On Thu, 17 Oct 2002, Steven Gray wrote:
> 
> Windows platform
> libwww version 5.4.0 built as DLLs
> NoCacheClient profile
> Using HTLoadToFile with an "ftp://user:pwd@foo.bar/file" URL.
> Note, an identically coded HTTP request "http://foo.bar/file"
> does not cause this bug to occur.
> 
> The above FTP URL causes a memory access violation to occur
> within HTChannel_deleteAll() when I attempt cleanup via
> HTProfile_delete()....

I had the exact same problem, and after much digging found a patch from
Peter Stamfest that solves it.  The patch, along with an explanation,
can be found at
http://lists.w3.org/Archives/Public/www-lib/2000JulSep/0241.html

> For me, the bandaid solution was to modify the implementation of 
> HTHost_getReadNet() with this ugly hack:
> 
> PUBLIC HTNet * HTHost_getReadNet(HTHost * host)
> {
> #ifdef WIN32 /* !!!yikes!!! */
>    if (IsBadReadPtr(host->pipeline, 1))
>       return NULL;
> #endif
>     return host ? (HTNet *) HTList_firstObject(host->pipeline) : NULL;
> }

Peter's patch fixes the problem at the source ie: when the channel is
first deleted, once the FTP operation is complete.  This is much neater
than using the Win32 IsBadReadPtr function later on in the game.

Regards,

Tim Serong
-- 
tim.serong@conceiva.com
http://www.conceiva.com

Received on Wednesday, 12 March 2003 00:12:19 UTC