From owner-svn-src-stable@FreeBSD.ORG Thu Feb 9 09:01:03 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DE11065679; Thu, 9 Feb 2012 09:01:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93F598FC21; Thu, 9 Feb 2012 09:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19913dH090902; Thu, 9 Feb 2012 09:01:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19913Mm090900; Thu, 9 Feb 2012 09:01:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090901.q19913Mm090900@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 09:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231259 - stable/7/contrib/pf/ftp-proxy X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:01:03 -0000 Author: bz Date: Thu Feb 9 09:01:03 2012 New Revision: 231259 URL: http://svn.freebsd.org/changeset/base/231259 Log: MF8 r224326: Flush output buffers before closing TCP session. Fixes the case where the proxy would eat the 221 response coming from the server towards the client. Obtained from: OpenBSD r1.18 PR: bin/154469 Modified: stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Directory Properties: stable/7/contrib/pf/ (props changed) Modified: stable/7/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Thu Feb 9 08:41:56 2012 (r231258) +++ stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Thu Feb 9 09:01:03 2012 (r231259) @@ -273,6 +273,12 @@ end_session(struct session *s) logmsg(LOG_INFO, "#%d ending session", s->id); + /* Flush output buffers. */ + if (s->client_bufev && s->client_fd != -1) + evbuffer_write(s->client_bufev->output, s->client_fd); + if (s->server_bufev && s->server_fd != -1) + evbuffer_write(s->server_bufev->output, s->server_fd); + if (s->client_fd != -1) close(s->client_fd); if (s->server_fd != -1)