From f298644bdaf5426ff25b0655dcf12a6823b19875 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Thu, 17 Jan 2008 20:01:55 +0000 Subject: [PATCH] * Do not try to read non existing response bodies of HEAD requests. PR: 34275 Submitted by: Takashi Sato Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@612954 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ support/ab.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index be0eecf50d..2f7f42e8f9 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) ab: Do not try to read non existing response bodies of HEAD requests. + PR 34275 [Takashi Sato ] + *) Support chroot on Unix-family platforms PR 43596 [Dimitar Pashev ] diff --git a/support/ab.c b/support/ab.c index 58299a3db2..46040af0d4 100644 --- a/support/ab.c +++ b/support/ab.c @@ -1463,7 +1463,8 @@ static void read_connection(struct connection * c) cl = strstr(c->cbuff, "Content-length:"); if (cl) { c->keepalive = 1; - c->length = atoi(cl + 16); + /* response to HEAD doesn't have entity body */ + c->length = posting >= 0 ? atoi(cl + 16) : 0; } /* The response may not have a Content-Length header */ if (!cl) { -- 2.40.0