aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDerek Higgins <derekh@redhat.com>2013-10-03 23:41:56 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-10-07 14:16:39 +0200
commit4cd444e01ad0da91231bebb66f58698f63666cc9 (patch)
treea2b80405aeb749871e22e39e4eb0f90c9094f288 /lib
parent826447849035030afa55ad02ee05b669f1735904 (diff)
HTTP: Output http response 304 when modified time is too old
When using the -w '%{http_code}' flag and simulating a Not Modified then 304 should be output.
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 760e79d9f..533e394b6 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -542,6 +542,10 @@ static CURLcode readwrite_data(struct SessionHandle *data,
if(!Curl_meets_timecondition(data, k->timeofdoc)) {
*done = TRUE;
+ /* We're simulating a http 304 from server so we return
+ what should have been returned from the server */
+ data->info.httpcode = 304;
+ infof(data, "Simulate a HTTP 304 response!\n");
/* we abort the transfer before it is completed == we ruin the
re-use ability. Close the connection */
conn->bits.close = TRUE;