Commit 1dbd3c74 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Insert an empty place-holder for the PROXY protocol.

parent 32ad2869
......@@ -78,6 +78,7 @@ varnishd_SOURCES = \
mgt/mgt_shmem.c \
mgt/mgt_vcc.c \
mgt/mgt_vcl.c \
proxy/cache_proxy_proto.c \
storage/stevedore.c \
storage/stevedore_mgt.c \
storage/stevedore_utils.c \
......
......@@ -977,6 +977,9 @@ 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;
/* cache_range.c [VRG] */
void VRG_dorange(struct req *req, struct busyobj *bo, const char *r);
......@@ -990,7 +993,7 @@ void SES_DeletePool(struct sesspool *sp);
int SES_Reschedule_Req(struct req *);
struct req *SES_GetReq(const struct worker *, struct sess *);
void SES_ReleaseReq(struct req *);
void SES_Proto_Sess(struct worker *wrk, void *arg);
task_func_t SES_Proto_Sess;
#define SESS_ATTR(UP, low, typ, len) \
int SES_Get_##low(const struct sess *sp, typ *dst); \
......
......@@ -240,6 +240,9 @@ SES_Proto_Sess(struct worker *wrk, void *arg)
sp->sess_step = S_STP_H1NEWREQ;
wrk->task.func = ses_proto_req;
wrk->task.priv = req;
} else if (sp->sess_step < S_STP_PROXY_LAST) {
wrk->task.func = VPX_Proto_Sess;
wrk->task.priv = sp;
} else {
WRONG("Wrong session step");
}
......
......@@ -20,11 +20,12 @@ flexelint \
-DVARNISH_VCL_DIR=\"foo\" \
cache/*.c \
common/*.c \
storage/*.c \
waiter/*.c \
hash/*.c \
http1/*.c \
mgt/*.c \
proxy/*.c \
storage/*.c \
waiter/*.c \
../../lib/libvarnish/*.c \
../../lib/libvarnishcompat/execinfo.c \
../../lib/libvcc/*.c \
......
......@@ -183,6 +183,9 @@ MAC_Arg(const char *arg)
if (av[2] == NULL || !strcmp(av[2], "HTTP/1")) {
mh->first_step = S_STP_H1NEWSESS;
mh->proto_name = "HTTP/1";
} else if (!strcmp(av[2], "PROXY")) {
mh->first_step = S_STP_PROXYNEWSESS;
mh->proto_name = "PROXY";
} else {
ARGV_ERR("Unknown protocol '%s'\n", av[2]);
}
......
/*-
* 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.
*
*/
#include "config.h"
#include "../cache/cache.h"
void __match_proto__(task_func_t)
VPX_Proto_Sess(struct worker *wrk, void *priv)
{
(void)wrk;
(void)priv;
INCOMPL();
}
......@@ -35,6 +35,9 @@ SESS_STEP(h1newsess, H1NEWSESS)
SESS_STEP(h1newreq, H1NEWREQ)
SESS_STEP(h1working, H1WORKING)
SESS_STEP(h1_last, H1_LAST)
SESS_STEP(proxynewsess, PROXYNEWSESS)
SESS_STEP(proxy_last, PROXY_LAST)
#endif
#ifdef REQ_STEP
......
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