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
8ac48328
Commit
8ac48328
authored
Mar 11, 2015
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One nitpick commit a day keeps the OCD away
parent
2b010c8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
cache_vrt_priv.c
bin/varnishd/cache/cache_vrt_priv.c
+2
-3
vtim.c
lib/libvarnish/vtim.c
+8
-9
No files found.
bin/varnishd/cache/cache_vrt_priv.c
View file @
8ac48328
...
...
@@ -132,10 +132,9 @@ VRT_priv_top(VRT_CTX, void *vmod_id)
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
top
,
REQ_MAGIC
);
id
=
(
uintptr_t
)
&
ctx
->
req
->
top
->
top
;
}
else
{
return
NULL
;
return
(
VRT_priv_dynamic
(
ctx
,
id
,
(
uintptr_t
)
vmod_id
));
}
return
(
VRT_priv_dynamic
(
ctx
,
id
,
(
uintptr_t
)
vmod_id
)
);
return
(
NULL
);
}
/*--------------------------------------------------------------------
...
...
lib/libvarnish/vtim.c
View file @
8ac48328
...
...
@@ -81,11 +81,11 @@ static const char * const month_name[] = {
};
static
const
int
days_in_month
[]
=
{
31
,
29
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
,
31
,
29
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
};
static
const
int
days_before_month
[]
=
{
0
,
31
,
59
,
90
,
120
,
151
,
181
,
212
,
243
,
273
,
304
,
334
0
,
31
,
59
,
90
,
120
,
151
,
181
,
212
,
243
,
273
,
304
,
334
};
/*
...
...
@@ -269,9 +269,8 @@ VTIM_parse(const char *p)
DIGIT
(
100
,
year
);
DIGIT
(
10
,
year
);
DIGIT
(
1
,
year
);
}
else
if
(
!
memcmp
(
p
,
more_weekday
[
weekday
],
strlen
(
more_weekday
[
weekday
])))
{
}
else
if
(
!
memcmp
(
p
,
more_weekday
[
weekday
],
strlen
(
more_weekday
[
weekday
])))
{
/* RFC850 -- "Sunday, 06-Nov-94 08:49:37 GMT" */
p
+=
strlen
(
more_weekday
[
weekday
]);
MUSTBE
(
','
);
...
...
@@ -302,7 +301,7 @@ VTIM_parse(const char *p)
if
(
*
p
!=
'\0'
)
FAIL
();
if
(
sec
<
0
||
sec
>
60
)
/
/ Leapseconds!
if
(
sec
<
0
||
sec
>
60
)
/
* Leapseconds! */
FAIL
();
if
(
min
<
0
||
min
>
59
)
FAIL
();
...
...
@@ -321,7 +320,7 @@ VTIM_parse(const char *p)
if
(
month
==
2
&&
mday
>
28
&&
!
leap
)
FAIL
();
if
(
sec
==
60
)
// Ignore Leapseconds
if
(
sec
==
60
)
/* Ignore Leapseconds */
sec
--
;
t
=
((
hour
*
60
.)
+
min
)
*
60
.
+
sec
;
...
...
@@ -334,12 +333,12 @@ VTIM_parse(const char *p)
d
+=
(
year
%
100
)
*
365
;
/* There are 365 days in a year */
if
((
year
%
100
)
>
0
)
/* And a leap day every four years */
d
+=
(((
year
%
100
)
-
1
)
/
4
);
d
+=
(((
year
%
100
)
-
1
)
/
4
);
d
+=
((
year
/
100
)
-
20
)
*
/* Days relative to y2000 */
(
100
*
365
+
24
);
/* 24 leapdays per year in a century */
d
+=
((
year
-
1
)
/
400
)
-
4
;
/* And one more every 400 years */
d
+=
((
year
-
1
)
/
400
)
-
4
;
/* And one more every 400 years */
/*
* Now check weekday, if we have one.
...
...
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