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
6ce5b1ef
Commit
6ce5b1ef
authored
Aug 06, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generic uint{32,64} OA_ accessor functions, use for VXID.
parent
dd7083a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
9 deletions
+63
-9
cache.h
bin/varnishd/cache/cache.h
+4
-0
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-3
cache_obj.c
bin/varnishd/cache/cache_obj.c
+58
-6
No files found.
bin/varnishd/cache/cache.h
View file @
6ce5b1ef
...
...
@@ -1068,6 +1068,10 @@ int ObjCopyAttr(struct objcore *ocd, struct objcore *ocs, struct dstat *ds,
int
ObjSetDouble
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
double
);
int
ObjGetDouble
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
double
*
);
int
ObjSetU32
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
uint32_t
);
int
ObjGetU32
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
uint32_t
*
);
int
ObjSetU64
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
uint64_t
);
int
ObjGetU64
(
struct
objcore
*
,
struct
dstat
*
,
enum
obj_attr
,
uint64_t
*
);
/* cache_panic.c */
void
PAN_Init
(
void
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
6ce5b1ef
...
...
@@ -102,7 +102,6 @@ vbf_beresp2obj(struct busyobj *bo)
uint16_t
nhttp
;
struct
object
*
obj
;
struct
http
*
hp
,
*
hp2
;
void
*
vp
;
l
=
0
;
...
...
@@ -152,8 +151,7 @@ vbf_beresp2obj(struct busyobj *bo)
VSB_delete
(
vary
);
}
vp
=
ObjSetattr
(
bo
->
fetch_objcore
,
bo
->
stats
,
OA_VXID
,
4
);
vbe32enc
(
vp
,
bo
->
vsl
->
wid
);
AZ
(
ObjSetU32
(
bo
->
fetch_objcore
,
bo
->
stats
,
OA_VXID
,
bo
->
vsl
->
wid
));
WS_Assert
(
bo
->
ws_o
);
/* Filter into object */
...
...
bin/varnishd/cache/cache_obj.c
View file @
6ce5b1ef
...
...
@@ -297,13 +297,10 @@ ObjCopyAttr(struct objcore *ocd, struct objcore *ocs, struct dstat *ds,
unsigned
ObjGetXID
(
struct
objcore
*
oc
,
struct
dstat
*
ds
)
{
ssize_t
l
;
void
*
p
;
uint32_t
u
;
p
=
ObjGetattr
(
oc
,
ds
,
OA_VXID
,
&
l
);
AN
(
p
);
assert
(
l
==
4
);
return
(
vbe32dec
(
p
));
AZ
(
ObjGetU32
(
oc
,
ds
,
OA_VXID
,
&
u
));
return
(
u
);
}
/*--------------------------------------------------------------------
...
...
@@ -347,3 +344,58 @@ ObjGetDouble(struct objcore *oc, struct dstat *ds, enum obj_attr a, double *d)
}
return
(
0
);
}
/*--------------------------------------------------------------------
*/
int
ObjSetU64
(
struct
objcore
*
oc
,
struct
dstat
*
ds
,
enum
obj_attr
a
,
uint64_t
t
)
{
void
*
vp
;
vp
=
ObjSetattr
(
oc
,
ds
,
a
,
sizeof
t
);
if
(
vp
==
NULL
)
return
(
-
1
);
vbe64enc
(
vp
,
t
);
return
(
0
);
}
int
ObjGetU64
(
struct
objcore
*
oc
,
struct
dstat
*
ds
,
enum
obj_attr
a
,
uint64_t
*
d
)
{
void
*
vp
;
ssize_t
l
;
vp
=
ObjGetattr
(
oc
,
ds
,
a
,
&
l
);
if
(
vp
==
NULL
||
l
!=
sizeof
*
d
)
return
(
-
1
);
if
(
d
!=
NULL
)
*
d
=
vbe64dec
(
vp
);
return
(
0
);
}
int
ObjSetU32
(
struct
objcore
*
oc
,
struct
dstat
*
ds
,
enum
obj_attr
a
,
uint32_t
t
)
{
void
*
vp
;
vp
=
ObjSetattr
(
oc
,
ds
,
a
,
sizeof
t
);
if
(
vp
==
NULL
)
return
(
-
1
);
vbe32enc
(
vp
,
t
);
return
(
0
);
}
int
ObjGetU32
(
struct
objcore
*
oc
,
struct
dstat
*
ds
,
enum
obj_attr
a
,
uint32_t
*
d
)
{
void
*
vp
;
ssize_t
l
;
vp
=
ObjGetattr
(
oc
,
ds
,
a
,
&
l
);
if
(
vp
==
NULL
||
l
!=
sizeof
*
d
)
return
(
-
1
);
if
(
d
!=
NULL
)
*
d
=
vbe32dec
(
vp
);
return
(
0
);
}
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