Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
c4b7322c
Commit
c4b7322c
authored
Sep 03, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly book-end the predictive vary code.
parent
ed47f83d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
20 deletions
+31
-20
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+2
-17
cache_vary.c
bin/varnishd/cache/cache_vary.c
+25
-0
cache_ws.c
bin/varnishd/cache/cache_ws.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
c4b7322c
...
...
@@ -987,6 +987,7 @@ struct vsb *VRY_Create(struct req *sp, const struct http *hp);
int
VRY_Match
(
struct
req
*
,
const
uint8_t
*
vary
);
void
VRY_Validate
(
const
uint8_t
*
vary
);
void
VRY_Prep
(
struct
req
*
);
void
VRY_Finish
(
struct
req
*
req
,
struct
busyobj
*
bo
);
/* cache_vcl.c */
void
VCL_Init
(
void
);
...
...
@@ -1034,7 +1035,7 @@ void WS_ReleaseP(struct ws *ws, char *ptr);
void
WS_Assert
(
const
struct
ws
*
ws
);
void
WS_Reset
(
struct
ws
*
ws
,
char
*
p
);
char
*
WS_Alloc
(
struct
ws
*
ws
,
unsigned
bytes
);
char
*
WS_Copy
(
struct
ws
*
ws
,
const
char
*
str
,
int
len
);
void
*
WS_Copy
(
struct
ws
*
ws
,
const
void
*
str
,
int
len
);
char
*
WS_Snapshot
(
struct
ws
*
ws
);
/* rfc2616.c */
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
c4b7322c
...
...
@@ -811,19 +811,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
req
->
busyobj
=
bo
;
/* One ref for req, one for FetchBody */
bo
->
refcount
=
2
;
VRY_Validate
(
req
->
vary_b
);
if
(
req
->
vary_l
!=
NULL
)
{
bo
->
vary
=
(
void
*
)
WS_Copy
(
bo
->
ws
,
(
void
*
)
req
->
vary_b
,
req
->
vary_l
-
req
->
vary_b
);
AN
(
bo
->
vary
);
VRY_Validate
(
bo
->
vary
);
}
else
bo
->
vary
=
NULL
;
WS_Release
(
req
->
ws
,
0
);
req
->
vary_b
=
NULL
;
req
->
vary_l
=
NULL
;
req
->
vary_e
=
NULL
;
VRY_Finish
(
req
,
bo
);
oc
->
busyobj
=
bo
;
wrk
->
stats
.
cache_miss
++
;
...
...
@@ -840,10 +828,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
req
->
obj
=
o
;
WS_Release
(
req
->
ws
,
0
);
req
->
vary_b
=
NULL
;
req
->
vary_l
=
NULL
;
req
->
vary_e
=
NULL
;
VRY_Finish
(
req
,
NULL
);
if
(
oc
->
flags
&
OC_F_PASS
)
{
wrk
->
stats
.
cache_hitpass
++
;
...
...
bin/varnishd/cache/cache_vary.c
View file @
c4b7322c
...
...
@@ -198,6 +198,31 @@ VRY_Prep(struct req *req)
req
->
vary_b
[
2
]
=
'\0'
;
}
/**********************************************************************
* Finish predictive vary procssing
*/
void
VRY_Finish
(
struct
req
*
req
,
struct
busyobj
*
bo
)
{
if
(
bo
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
VRY_Validate
(
req
->
vary_b
);
if
(
req
->
vary_l
!=
NULL
)
{
bo
->
vary
=
WS_Copy
(
bo
->
ws
,
req
->
vary_b
,
req
->
vary_l
-
req
->
vary_b
);
AN
(
bo
->
vary
);
VRY_Validate
(
bo
->
vary
);
}
else
bo
->
vary
=
NULL
;
}
WS_Release
(
req
->
ws
,
0
);
req
->
vary_b
=
NULL
;
req
->
vary_l
=
NULL
;
req
->
vary_e
=
NULL
;
}
/**********************************************************************
* Match vary strings, and build a new cached string if possible.
*
...
...
bin/varnishd/cache/cache_ws.c
View file @
c4b7322c
...
...
@@ -116,8 +116,8 @@ WS_Alloc(struct ws *ws, unsigned bytes)
return
(
r
);
}
char
*
WS_Copy
(
struct
ws
*
ws
,
const
char
*
str
,
int
len
)
void
*
WS_Copy
(
struct
ws
*
ws
,
const
void
*
str
,
int
len
)
{
char
*
r
;
unsigned
bytes
;
...
...
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