From owner-cvs-all Thu Oct 24 18:18:20 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F45E37B401; Thu, 24 Oct 2002 18:18:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA0D343E4A; Thu, 24 Oct 2002 18:18:18 -0700 (PDT) (envelope-from njl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9P1HWmV045396; Thu, 24 Oct 2002 18:17:32 -0700 (PDT) (envelope-from njl@repoman.freebsd.org) Received: (from njl@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9P1HWVl045395; Thu, 24 Oct 2002 18:17:32 -0700 (PDT) Message-Id: <200210250117.g9P1HWVl045395@repoman.freebsd.org> From: Nate Lawson Date: Thu, 24 Oct 2002 18:17:32 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libfetch ftp.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message