From 76a542a03e11db7fbe61e8c151f0d7f8124fd7d1 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 21 Aug 2008 14:21:38 +0000 Subject: [PATCH] merge git-svn-id: file:///svn/phpbb/trunk@8773 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download/file.php | 4 ++++ phpBB/includes/db/dbal.php | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 1616448c0b..830967c213 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -456,6 +456,10 @@ function send_file_to_browser($attachment, $upload_dir, $category) { header("Content-Length: $size"); } + + // Close the db connection before sending the file + $db->sql_close(); + if (!set_modified_headers($attachment['filetime'], $user->browser)) { // Try to deliver in chunks diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index b88873df46..af5dfa059b 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -147,7 +147,13 @@ class dbal $this->sql_freeresult($query_id); } - return $this->_sql_close(); + // Connection closed correctly. Set db_connect_id to false to prevent errors + if (($result = $this->_sql_close())) + { + $this->db_connect_id = false; + } + + return $result; } /**