Skip to contentSkip to conversation

http: fix superfluous null line in range request header

PATCH Applied Michael Chang 2 participants 2 messages Apr 6, 2016 – Apr 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 http: fix superfluous null line in range request header

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(-)
grub-core/net/http.c +1 -2
index 4684f8b..a7c5101 100644
@@ -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));
     }
Signature · 1 line
2.6.2
#1 lore raw

06.04.2016 13:19, Michael Chang пишет:

Quoted 3 lines

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.

Applied. Thanks!

Quoted 20 lines
---
 grub-core/net/http.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
grub-core/net/http.c +1 -2
index 4684f8b..a7c5101 100644
@@ -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));
     }