Commit 2ea02cb4 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Segregate HTTP1 protocol stuff in its own include file.

parent fec6289e
......@@ -103,6 +103,7 @@ noinst_HEADERS = \
cache/cache_pool.h \
common/heritage.h \
hash/hash_slinger.h \
http1/cache_http1.h \
mgt/mgt.h \
mgt/mgt_cli.h \
mgt/mgt_param.h \
......
......@@ -707,27 +707,10 @@ ssize_t VBO_waitlen(struct worker *, struct busyobj *, ssize_t l);
void VBO_setstate(struct busyobj *bo, enum busyobj_state_e next);
void VBO_waitstate(struct busyobj *bo, enum busyobj_state_e want);
/* cache_http1_fetch.c [V1F] */
int V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, const char *def_host);
void V1F_Setup_Fetch(struct vfp_ctx *vfc, struct http_conn *htc);
/* cache_http1_fsm.c [HTTP1] */
typedef int (req_body_iter_f)(struct req *, void *priv, void *ptr, size_t);
void HTTP1_Session(struct worker *, struct req *);
extern const int HTTP1_Req[3];
extern const int HTTP1_Resp[3];
/* cache_http1_deliver.c */
vtr_deliver_f V1D_Deliver;
/* cache_http1_pipe.c */
void V1P_Init(void);
void V1P_Process(struct req *, struct busyobj *, int fd, struct VSC_C_vbe *);
/* cache_req_body.c */
int VRB_Ignore(struct req *req);
ssize_t VRB_Cache(struct req *req, ssize_t maxsize);
typedef int (req_body_iter_f)(struct req *, void *priv, void *ptr, size_t);
ssize_t VRB_Iterate(struct req *req, req_body_iter_f *func, void *priv);
void VRB_Free(struct req *req);
......@@ -958,14 +941,6 @@ int Pool_TrySumstat(struct worker *wrk);
void Pool_PurgeStat(unsigned nobj);
int Pool_Task_Any(struct pool_task *task, enum task_how how);
#define V1L_IsReleased(w) ((w)->v1l == NULL)
void V1L_Chunked(const struct worker *w);
void V1L_EndChunk(const struct worker *w);
void V1L_Reserve(struct worker *, struct ws *, int *fd, struct vsl_log *, double t0);
unsigned V1L_Flush(const struct worker *w);
unsigned V1L_FlushRelease(struct worker *w);
size_t V1L_Write(const struct worker *w, const void *ptr, ssize_t len);
/* cache_proxy.c [VPX] */
task_func_t VPX_Proto_Sess;
......
......@@ -41,6 +41,7 @@
#include "cache_director.h"
#include "cache_backend.h"
#include "http1/cache_http1.h"
#define FIND_TMO(tmx, dst, bo, be) \
do { \
......
......@@ -621,9 +621,6 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
return (F_STP_ERROR);
}
assert(V1L_IsReleased(wrk));
if (bo->do_esi)
ObjSetFlag(bo->wrk, bo->fetch_objcore, OF_ESIPROC, 1);
......@@ -916,7 +913,6 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
WRONG("Illegal fetch_step");
}
}
assert(V1L_IsReleased(wrk));
assert(bo->director_state == DIR_S_NULL);
......
......@@ -33,6 +33,7 @@
#include <stdlib.h>
#include "cache.h"
#include "http1/cache_http1.h"
#include "common/heritage.h"
#include "vcli_priv.h"
......
......@@ -33,6 +33,7 @@
#include <stdlib.h>
#include "cache.h"
#include "http1/cache_http1.h"
#include "cache_filter.h"
#include "vtim.h"
#include "hash/hash_slinger.h"
......
......@@ -47,6 +47,7 @@
#include "cache.h"
#include "cache_pool.h"
#include "http1/cache_http1.h"
#include "vsa.h"
#include "vtcp.h"
......
/*-
* Copyright (c) 2015 Varnish Software 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.
*
*/
/* cache_http1_fetch.c [V1F] */
int V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, const char *def_host);
void V1F_Setup_Fetch(struct vfp_ctx *vfc, struct http_conn *htc);
/* cache_http1_fsm.c [HTTP1] */
void HTTP1_Session(struct worker *, struct req *);
extern const int HTTP1_Req[3];
extern const int HTTP1_Resp[3];
/* cache_http1_deliver.c */
vtr_deliver_f V1D_Deliver;
/* cache_http1_pipe.c */
void V1P_Init(void);
void V1P_Process(struct req *, struct busyobj *, int fd, struct VSC_C_vbe *);
/* cache_http1_line.c */
void V1L_Chunked(const struct worker *w);
void V1L_EndChunk(const struct worker *w);
void V1L_Reserve(struct worker *, struct ws *, int *fd, struct vsl_log *,
double t0);
unsigned V1L_Flush(const struct worker *w);
unsigned V1L_FlushRelease(struct worker *w);
size_t V1L_Write(const struct worker *w, const void *ptr, ssize_t len);
......@@ -31,6 +31,7 @@
#include "cache/cache.h"
#include "cache/cache_filter.h"
#include "cache_http1.h"
/*--------------------------------------------------------------------*/
......
......@@ -44,6 +44,7 @@
#include "cache/cache_director.h"
#include "cache/cache_backend.h"
#include "cache_http1.h"
/*--------------------------------------------------------------------
* Pass the request body to the backend
......
......@@ -38,6 +38,7 @@
#include <stdlib.h>
#include "cache/cache.h"
#include "cache_http1.h"
#include "hash/hash_slinger.h"
#include "vtcp.h"
......
......@@ -41,6 +41,7 @@
#include <stdio.h>
#include "cache/cache.h"
#include "cache_http1.h"
#include "vtim.h"
/*--------------------------------------------------------------------*/
......
......@@ -40,6 +40,7 @@
#include "vtcp.h"
#include "vtim.h"
#include "cache_http1.h"
#include "cache/cache_director.h"
#include "cache/cache_backend.h"
......
......@@ -46,6 +46,7 @@
#include "config.h"
#include "cache/cache.h"
#include "cache_http1.h"
#include "vct.h"
......
......@@ -40,6 +40,7 @@
#include "cache/cache.h"
#include "cache/cache_filter.h"
#include "cache_http1.h"
#include "vct.h"
......
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