grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] http: fix superfluous null line in range request header
@ 2016-04-06 10:19 Michael Chang
  2016-04-09  4:08 ` Andrei Borzenkov
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Chang @ 2016-04-06 10:19 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] http: fix superfluous null line in range request header
  2016-04-06 10:19 [PATCH] http: fix superfluous null line in range request header Michael Chang
@ 2016-04-09  4:08 ` Andrei Borzenkov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrei Borzenkov @ 2016-04-09  4:08 UTC (permalink / raw)
  To: grub-devel

06.04.2016 13:19, Michael Chang пишет:
> 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!

> ---
>  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));
>      }
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-09  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 10:19 [PATCH] http: fix superfluous null line in range request header Michael Chang
2016-04-09  4:08 ` Andrei Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).