From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ankZD-0001k9-Fp for mharc-grub-devel@gnu.org; Wed, 06 Apr 2016 06:20:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ankZ6-0001Wz-MJ for grub-devel@gnu.org; Wed, 06 Apr 2016 06:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ankZ1-0003O6-N1 for grub-devel@gnu.org; Wed, 06 Apr 2016 06:20:00 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:46585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ankZ1-0003O0-Gm for grub-devel@gnu.org; Wed, 06 Apr 2016 06:19:55 -0400 Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Wed, 06 Apr 2016 12:19:53 +0200 Received: from linux-9gqx.suse (nwb-a10-snat.microfocus.com [10.120.13.202]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Wed, 06 Apr 2016 11:19:22 +0100 Date: Wed, 6 Apr 2016 18:19:14 +0800 From: Michael Chang To: grub-devel@gnu.org Subject: [PATCH] http: fix superfluous null line in range request header Message-ID: <20160406101914.GA10786@linux-9gqx.suse> Mail-Followup-To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.221.5 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2016 10:20:05 -0000 At least the apache sever is very unhappy with that extra null line and will take more than ten seconds in responding to each range request, which slows down a lot the entire http file transfer process or even time out. --- grub-core/net/http.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c index 4684f8b..a7c5101 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -381,9 +381,8 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) ptr = nb->tail; grub_snprintf ((char *) ptr, sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX-" - "\r\n" "\r\n"), - "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n\r\n", + "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n", offset); grub_netbuff_put (nb, grub_strlen ((char *) ptr)); } -- 2.6.2