From 60b57b017d6d4bfb1248e7b16f5339ac64e234b0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 17 Apr 2014 21:33:34 +0200 Subject: BUG: chunks: chunked encoding requires a trailing CRLF Curl was not happy with the missing CRLF at the end. --- httpterm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/httpterm.c b/httpterm.c index 34c5df8..ba555cc 100644 --- a/httpterm.c +++ b/httpterm.c @@ -688,7 +688,7 @@ const char *HTTP_HELP = "
  • /?t=<time> :\n" " wait <time> milliseconds before responding. Eg: /?t=500\n" "
  • /?k={0|1} :\n" - " Enable transfer enconding chunked with 1 byte chunks\n" + " Enable transfer encoding chunked with 1 byte chunks\n" "
  • /?S={0|1} :\n" " Disable/enable use of splice() to send data\n" "
  • /?R={0|1} :\n" @@ -1826,13 +1826,13 @@ int event_cli_write(int fd) { s->to_write -= ret; /* in chunked mode, switch to "standard" data for sending - * the 3 final digits + * the 3 final digits, followed by a last \r\n for trailers. */ if (s->to_write == 3) { s->to_write = 0; - s->rep->l = 3; - s->rep->r = s->rep->h = s->rep->lr = s->rep->w = "0\r\n"; - s->rep->r += 3; + s->rep->l = 5; + s->rep->r = s->rep->h = s->rep->lr = s->rep->w = "0\r\n\r\n"; + s->rep->r += 5; } } -- 1.7.12.1