]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
http: fix superfluous null line in range request header
authorMichael Chang <mchang@suse.com>
Wed, 6 Apr 2016 10:19:14 +0000 (18:19 +0800)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 9 Apr 2016 04:08:13 +0000 (07:08 +0300)
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

index 4684f8b333c2a7bca2e1b398f2a9891380fa6696..a7c5101a13064659424293a0d57976ac4fef8d62 100644 (file)
@@ -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));
     }