Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2002 18:23:02 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Nate Lawson <njl@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libfetch ftp.c
Message-ID:  <Pine.BSF.4.21.0210241820500.70451-100000@root.org>
In-Reply-To: <200210250117.g9P1HWVl045395@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 24 Oct 2002, Nate Lawson wrote:
> njl         2002/10/24 18:17:32 PDT
> 
>   Modified files:
>     lib/libfetch         ftp.c 
>   Log:
>   The FTP connection caching needs a better interface -- connections are
>   closed through _fetch_close() which is the only one who knows the connection
>   REALLY was closed (since ref -> 0).  However, FTP keeps its own local
>   cached_connection and checks if it is valid by comparing it to NULL.  This
>   is bogus since it may have been freed elsewhere by _fetch_close().
>   
>   This change checks if we are closing the cached_connection and the ref is 1
>   (soon to be 0).  If so, set cached_connection to NULL so we don't
>   accidentally reuse it.  The REAL fix should be to move connection caching
>   to the common.c level (_fetch_* functions) and NULL the cache(s) in
>   _fetch_close().  Then all layers could benefit from caching.
>   
>   Revision  Changes    Path
>   1.83      +4 -0      src/lib/libfetch/ftp.c

Tested with pkg_add -r xpdf-1.01 which succeeded.  tjr's patch was the
first to fix the crash caused by this and this patch fixes other potential
error cases, for example:
  _ftp_cached_connect, _fetch_close, _ftp_cached_connect

-Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0210241820500.70451-100000>