Commit 80b3ecc0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make VRT_String() return a const char *

parent c3f399ca
......@@ -638,7 +638,7 @@ struct req {
double t_resp;
struct http_conn htc[1];
char *client_identity;
const char *client_identity;
/* HTTP request */
struct http *http;
......@@ -1029,7 +1029,11 @@ const char *VCL_Method_Name(unsigned);
/* cache_vrt.c */
char *VRT_String(struct ws *ws, const char *h, const char *p, va_list ap);
/*
* These prototypes go here, because we do not want to pollute vrt.h
* with va_list. VCC never generates direct calls to them.
*/
const char *VRT_String(struct ws *ws, const char *h, const char *p, va_list ap);
char *VRT_StringList(char *d, unsigned dl, const char *p, va_list ap);
void ESI_Deliver(struct req *);
......
......@@ -116,11 +116,13 @@ vrt_selecthttp(const struct vrt_ctx *ctx, enum gethdr_e where)
hp = ctx->http_obj;
break;
default:
INCOMPL();
WRONG("vrt_selecthttp 'where' invalid");
}
return (hp);
}
/*--------------------------------------------------------------------*/
char *
VRT_GetHdr(const struct vrt_ctx *ctx, const struct gethdr_s *hs)
{
......@@ -136,7 +138,7 @@ VRT_GetHdr(const struct vrt_ctx *ctx, const struct gethdr_s *hs)
}
/*--------------------------------------------------------------------
* XXX: Optimize the single element case ?
* Collapse a STRING_LIST in the space provided, or return NULL
*/
char *
......@@ -163,10 +165,10 @@ VRT_StringList(char *d, unsigned dl, const char *p, va_list ap)
}
/*--------------------------------------------------------------------
* XXX: Optimize the single element case ?
* Copy and merge a STRING_LIST into a workspace.
*/
char *
const char *
VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
{
char *b, *e;
......@@ -196,14 +198,14 @@ VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
}
/*--------------------------------------------------------------------
* Build a string on the request workspace
* Copy and merge a STRING_LIST on the current workspace
*/
const char *
VRT_CollectString(const struct vrt_ctx *ctx, const char *p, ...)
{
va_list ap;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->ws, WS_MAGIC);
......@@ -221,7 +223,7 @@ VRT_SetHdr(const struct vrt_ctx *ctx , const struct gethdr_s *hs,
{
struct http *hp;
va_list ap;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
AN(hs);
......
......@@ -50,7 +50,7 @@ static void
vrt_do_string(const struct http *hp, int fld,
const char *err, const char *p, va_list ap)
{
char *b;
const char *b;
AN(hp);
b = VRT_String(hp->ws, NULL, p, ap);
......@@ -165,7 +165,7 @@ void
VRT_l_client_identity(const struct vrt_ctx *ctx, const char *str, ...)
{
va_list ap;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
......@@ -248,7 +248,7 @@ void
VRT_l_beresp_storage(const struct vrt_ctx *ctx, const char *str, ...)
{
va_list ap;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
......
......@@ -260,5 +260,4 @@ char *VRT_REAL_string(const struct vrt_ctx *, double);
char *VRT_TIME_string(const struct vrt_ctx *, double);
const char *VRT_BOOL_string(unsigned);
const char *VRT_BACKEND_string(const struct director *d);
const char *VRT_CollectString(const struct vrt_ctx *, const char *p, ...);
......@@ -39,7 +39,7 @@ VCL_VOID __match_proto__(td_debug_panic)
vmod_panic(const struct vrt_ctx *ctx, const char *str, ...)
{
va_list ap;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
va_start(ap, str);
......
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