From c0b9dd27b553c2a2fff8e0259a7ad694172ece86 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 7 Jun 2011 13:40:11 +0200 Subject: HTTP time condition: force closure for 200 OK When a time condition isn't met, so that no body is delivered to the application even though a 2xx response is being read from the server, we must close the connection to avoid a re-use of the connection to be completely tricked. Added test 1128 to verify. --- lib/transfer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/transfer.c b/lib/transfer.c index c82fb3594..94cd6d6f9 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -563,6 +563,9 @@ static CURLcode readwrite_data(struct SessionHandle *data, if(!Curl_meets_timecondition(data, k->timeofdoc)) { *done = TRUE; + /* we abort the transfer before it is completed == we ruin the + re-use ability. Close the connection */ + conn->bits.close = TRUE; return CURLE_OK; } } /* we have a time condition */ -- cgit v1.2.3