Commit 85594125 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move the body_status enum to cache.h

parent c7991588
......@@ -65,7 +65,15 @@
#include "vsc.h"
#include "vsl.h"
#include "vtypes.h"
enum body_status {
BS_NONE,
BS_ZERO,
BS_ERROR,
BS_CHUNKED,
BS_LENGTH,
BS_EOF
};
/*
* NB: HDR_STATUS is only used in cache_http.c, everybody else uses the
......
......@@ -499,11 +499,6 @@ FetchBody(struct sess *sp)
AN(sp->director);
AssertObjPassOrBusy(sp->obj);
/*
* Determine if we have a body or not
* XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses
*/
AZ(sp->wrk->vgz_rx);
AZ(VTAILQ_FIRST(&sp->obj->store));
switch (sp->wrk->body_status) {
......@@ -542,9 +537,9 @@ FetchBody(struct sess *sp)
/*
* It is OK for ->end to just leave the last storage segment
* sitting on sp->wrk->storage, we will always call vfp_nop_end()
* to get it trimmed and added to the object.
* to get it trimmed or thrown out if empty.
*/
XXXAZ(vfp_nop_end(sp));
AZ(vfp_nop_end(sp));
WSL(sp->wrk, SLT_Fetch_Body, sp->vbc->fd, "%u %d %u",
sp->wrk->body_status, cls, mklen);
......@@ -554,9 +549,6 @@ FetchBody(struct sess *sp)
return (__LINE__);
}
if (cls == 0 && sp->wrk->do_close)
cls = 1;
if (cls < 0) {
sp->wrk->stats.fetch_failed++;
/* XXX: Wouldn't this store automatically be released ? */
......@@ -570,6 +562,9 @@ FetchBody(struct sess *sp)
return (__LINE__);
}
if (cls == 0 && sp->wrk->do_close)
cls = 1;
WSL(sp->wrk, SLT_Length, sp->vbc->fd, "%u", sp->obj->len);
{
......
......@@ -50,8 +50,7 @@ nobase_noinst_HEADERS = \
vrt.h \
vrt_obj.h \
vrt_stv_var.h \
vss.h \
vtypes.h
vss.h
vrt_stv_var.h vcl_returns.h vcl.h vrt_obj.h: $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vrt.h
@PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir)
......
/*-
* Copyright (c) 2010 Linpro AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
* Very special types, widely used, in their own #include to keep
* #include-infection minimal.
*/
enum body_status {
BS_NONE,
BS_ZERO,
BS_ERROR,
BS_CHUNKED,
BS_LENGTH,
BS_EOF
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment