From owner-svn-src-stable-8@FreeBSD.ORG Mon Jul 25 15:14:04 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B635106564A; Mon, 25 Jul 2011 15:14:04 +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 3A10A8FC12; Mon, 25 Jul 2011 15:14:04 +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 p6PFE4xQ062461; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFE466062459; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107251514.p6PFE466062459@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Jul 2011 15:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224326 - stable/8/contrib/pf/ftp-proxy X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:14:04 -0000 Author: bz Date: Mon Jul 25 15:14:03 2011 New Revision: 224326 URL: http://svn.freebsd.org/changeset/base/224326 Log: 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. This is a commit as HEAD got the change with the entire pf45 import. PR: bin/154469 Obtained from: OpenBSD r1.18 MFC after: 2 weeks Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:10:53 2011 (r224325) +++ stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:14:03 2011 (r224326) @@ -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)