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

"Tim Serong" <[email protected]>
Newsgroups gmane.comp.lib.libwww
Message-ID <[email protected]>
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:[email protected]/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
-- 
[email protected]
http://www.conceiva.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.