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
11d8d518
Commit
11d8d518
authored
Oct 01, 2012
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added parameter unique_xids -- use a mutex to ensure unique XIDs
Signed-off-by:
Geoff Simmons
<
geoff@uplex.de
>
parent
9e6a70f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
cache_center.c
bin/varnishd/cache_center.c
+10
-1
heritage.h
bin/varnishd/heritage.h
+2
-0
locks.h
bin/varnishd/locks.h
+1
-0
mgt_param.c
bin/varnishd/mgt_param.c
+6
-0
No files found.
bin/varnishd/cache_center.c
View file @
11d8d518
...
...
@@ -77,6 +77,7 @@ DOT acceptor -> start [style=bold,color=green]
#include "vsha256.h"
static
unsigned
xids
;
static
struct
lock
xids_mtx
;
/*--------------------------------------------------------------------
* WAIT
...
...
@@ -1478,7 +1479,13 @@ cnt_start(struct sess *sp)
sp
->
wrk
->
acct_tmp
.
req
++
;
/* Assign XID and log */
sp
->
xid
=
++
xids
;
/* XXX not locked */
if
(
params
->
unique_xids
)
{
Lck_Lock
(
&
xids_mtx
);
sp
->
xid
=
++
xids
;
Lck_Unlock
(
&
xids_mtx
);
}
else
sp
->
xid
=
++
xids
;
WSP
(
sp
,
SLT_ReqStart
,
"%s %s %u"
,
sp
->
addr
,
sp
->
port
,
sp
->
xid
);
/* Borrow VCL reference from worker thread */
...
...
@@ -1696,6 +1703,8 @@ CNT_Init(void)
srandomdev
();
srand48
(
random
());
xids
=
random
();
if
(
params
->
unique_xids
)
Lck_New
(
&
xids_mtx
,
lck_xids
);
CLI_AddFuncs
(
debug_cmds
);
}
...
...
bin/varnishd/heritage.h
View file @
11d8d518
...
...
@@ -214,6 +214,8 @@ struct params {
double
shortlived
;
struct
vre_limits
vre_limits
;
unsigned
unique_xids
;
};
/*
...
...
bin/varnishd/locks.h
View file @
11d8d518
...
...
@@ -49,4 +49,5 @@ LOCK(ban)
LOCK
(
vbp
)
LOCK
(
vbe
)
LOCK
(
backend
)
LOCK
(
xids
)
/*lint -restore */
bin/varnishd/mgt_param.c
View file @
11d8d518
...
...
@@ -974,6 +974,12 @@ static const struct parspec input_parspec[] = {
0
,
"10000"
,
""
},
{
"unique_xids"
,
tweak_bool
,
&
master
.
unique_xids
,
0
,
0
,
"Ensure that XIDs are uniquely assigned to requests "
"using an additional mutex.
\n
"
,
0
,
"off"
,
"bool"
},
{
NULL
,
NULL
,
NULL
}
};
...
...
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