Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
62a2da09
Commit
62a2da09
authored
Jun 25, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark failures on the WS rather than on struct http, there is no
advantage from having two mechanisms.
parent
bcdc20ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
cache.h
bin/varnishd/cache/cache.h
+1
-2
cache_http.c
bin/varnishd/cache/cache_http.c
+7
-6
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+6
-6
No files found.
bin/varnishd/cache/cache.h
View file @
62a2da09
...
...
@@ -197,7 +197,6 @@ struct http {
uint16_t
status
;
uint8_t
protover
;
uint8_t
conds
;
/* If-* headers present */
uint8_t
failed
;
/* usually: ws-alloc failed */
};
/*--------------------------------------------------------------------
...
...
@@ -1017,7 +1016,7 @@ const char *http_GetReq(const struct http *hp);
int
http_HdrIs
(
const
struct
http
*
hp
,
const
char
*
hdr
,
const
char
*
val
);
int
http_IsHdr
(
const
txt
*
hh
,
const
char
*
hdr
);
enum
sess_close
http_DoConnection
(
const
struct
http
*
);
void
http_CopyHome
(
struct
http
*
hp
);
void
http_CopyHome
(
const
struct
http
*
hp
);
void
http_Unset
(
struct
http
*
hp
,
const
char
*
hdr
);
void
http_CollectHdr
(
struct
http
*
hp
,
const
char
*
hdr
);
void
http_VSL_log
(
const
struct
http
*
hp
);
...
...
bin/varnishd/cache/cache_http.c
View file @
62a2da09
...
...
@@ -95,12 +95,12 @@ http_VSL_log(const struct http *hp)
/*--------------------------------------------------------------------*/
static
void
http_fail
(
struct
http
*
hp
)
http_fail
(
const
struct
http
*
hp
)
{
VSC_C_main
->
losthdr
++
;
VSLb
(
hp
->
vsl
,
SLT_Error
,
"out of workspace
"
);
hp
->
failed
=
1
;
VSLb
(
hp
->
vsl
,
SLT_Error
,
"out of workspace
(%s)"
,
hp
->
ws
->
id
);
WS_MarkOverflow
(
hp
->
ws
)
;
}
/*--------------------------------------------------------------------*/
...
...
@@ -210,7 +210,7 @@ http_SetH(const struct http *to, unsigned n, const char *fm)
/*--------------------------------------------------------------------*/
static
void
http_PutField
(
struct
http
*
to
,
int
field
,
const
char
*
string
)
http_PutField
(
const
struct
http
*
to
,
int
field
,
const
char
*
string
)
{
char
*
p
;
...
...
@@ -274,7 +274,8 @@ http_CollectHdr(struct http *hp, const char *hdr)
unsigned
u
,
l
,
ml
,
f
,
x
,
d
;
char
*
b
=
NULL
,
*
e
=
NULL
;
if
(
hp
->
failed
)
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
if
(
WS_Overflowed
(
hp
->
ws
))
return
;
l
=
hdr
[
0
];
assert
(
l
==
strlen
(
hdr
+
1
));
...
...
@@ -760,7 +761,7 @@ http_Merge(const struct http *fm, struct http *to, int not_ce)
*/
void
http_CopyHome
(
struct
http
*
hp
)
http_CopyHome
(
const
struct
http
*
hp
)
{
unsigned
u
,
l
;
char
*
p
;
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
62a2da09
...
...
@@ -50,7 +50,7 @@ static char vrt_hostname[255] = "";
*/
static
void
vrt_do_string
(
struct
http
*
hp
,
int
fld
,
vrt_do_string
(
const
struct
http
*
hp
,
int
fld
,
const
char
*
err
,
const
char
*
p
,
va_list
ap
)
{
const
char
*
b
;
...
...
@@ -60,7 +60,7 @@ vrt_do_string(struct http *hp, int fld,
b
=
VRT_String
(
hp
->
ws
,
NULL
,
p
,
ap
);
if
(
b
==
NULL
||
*
b
==
'\0'
)
{
VSLb
(
hp
->
vsl
,
SLT_LostHeader
,
"%s"
,
err
);
hp
->
failed
=
1
;
WS_MarkOverflow
(
hp
->
ws
)
;
return
;
}
http_SetH
(
hp
,
fld
,
b
);
...
...
@@ -100,11 +100,11 @@ VRT_l_##obj##_status(const struct vrt_ctx *ctx, long num) \
CHECK_OBJ_NOTNULL(ctx->http_##obj, HTTP_MAGIC); \
if (num > 65535) { \
VSLb(ctx->vsl, SLT_VCL_Error, "%s.status > 65535", #obj); \
ctx->http_##obj->failed = 1;
\
WS_MarkOverflow(ctx->http_##obj->ws);
\
} else if ((num % 1000) < 100) { \
VSLb(ctx->vsl, SLT_VCL_Error, "illegal %s.status (..0##)", \
#obj); \
ctx->http_##obj->failed = 1;
\
WS_MarkOverflow(ctx->http_##obj->ws);
\
} else { \
http_SetStatus(ctx->http_##obj, (uint16_t)num); \
} \
...
...
@@ -244,7 +244,7 @@ VRT_l_client_identity(const struct vrt_ctx *ctx, const char *str, ...)
va_end
(
ap
);
if
(
b
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_LostHeader
,
"client.identity"
);
ctx
->
req
->
http
->
failed
=
1
;
WS_MarkOverflow
(
ctx
->
req
->
http
->
ws
)
;
return
;
}
ctx
->
req
->
client_identity
=
b
;
...
...
@@ -331,7 +331,7 @@ VRT_l_beresp_storage_hint(const struct vrt_ctx *ctx, const char *str, ...)
va_end
(
ap
);
if
(
b
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_LostHeader
,
"storage.hint"
);
ctx
->
bo
->
beresp
->
failed
=
1
;
WS_MarkOverflow
(
ctx
->
bo
->
beresp
->
ws
)
;
return
;
}
ctx
->
bo
->
storage_hint
=
b
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment