Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
488c2d0c
Commit
488c2d0c
authored
Mar 03, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Mar 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Support the Cache-Control max-age directive for setting url cache entry expiration.
parent
2d323430
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
6 deletions
+64
-6
http.c
dlls/wininet/http.c
+64
-6
No files found.
dlls/wininet/http.c
View file @
488c2d0c
...
...
@@ -3761,16 +3761,74 @@ static void HTTP_ProcessExpires(http_request_t *request)
BOOL
expirationFound
=
FALSE
;
int
headerIndex
;
headerIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
szExpires
,
0
,
FALSE
);
/* Look for a Cache-Control header with a max-age directive, as it takes
* precedence over the Expires header.
*/
headerIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
szCache_Control
,
0
,
FALSE
);
if
(
headerIndex
!=
-
1
)
{
LPHTTPHEADERW
expires
Header
=
&
request
->
custHeaders
[
headerIndex
];
FILETIME
ft
;
LPHTTPHEADERW
cc
Header
=
&
request
->
custHeaders
[
headerIndex
];
LPWSTR
ptr
;
if
(
HTTP_ParseDate
(
expiresHeader
->
lpszValue
,
&
ft
)
)
for
(
ptr
=
ccHeader
->
lpszValue
;
ptr
&&
*
ptr
;
)
{
expirationFound
=
TRUE
;
request
->
expires
=
ft
;
LPWSTR
comma
=
strchrW
(
ptr
,
','
),
end
,
equal
;
if
(
comma
)
end
=
comma
;
else
end
=
ptr
+
strlenW
(
ptr
);
for
(
equal
=
end
-
1
;
equal
>
ptr
&&
*
equal
!=
'='
;
equal
--
)
;
if
(
*
equal
==
'='
)
{
static
const
WCHAR
max_age
[]
=
{
'm'
,
'a'
,
'x'
,
'-'
,
'a'
,
'g'
,
'e'
,
0
};
if
(
!
strncmpiW
(
ptr
,
max_age
,
equal
-
ptr
-
1
))
{
LPWSTR
nextPtr
;
unsigned
long
age
;
age
=
strtoulW
(
equal
+
1
,
&
nextPtr
,
10
);
if
(
nextPtr
>
equal
+
1
)
{
LARGE_INTEGER
ft
;
NtQuerySystemTime
(
&
ft
);
/* Age is in seconds, FILETIME resolution is in
* 100 nanosecond intervals.
*/
ft
.
QuadPart
+=
age
*
(
ULONGLONG
)
1000000
;
request
->
expires
.
dwLowDateTime
=
ft
.
u
.
LowPart
;
request
->
expires
.
dwHighDateTime
=
ft
.
u
.
HighPart
;
expirationFound
=
TRUE
;
}
}
}
if
(
comma
)
{
ptr
=
comma
+
1
;
while
(
isspaceW
(
*
ptr
))
ptr
++
;
}
else
ptr
=
NULL
;
}
}
if
(
!
expirationFound
)
{
headerIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
szExpires
,
0
,
FALSE
);
if
(
headerIndex
!=
-
1
)
{
LPHTTPHEADERW
expiresHeader
=
&
request
->
custHeaders
[
headerIndex
];
FILETIME
ft
;
if
(
HTTP_ParseDate
(
expiresHeader
->
lpszValue
,
&
ft
))
{
expirationFound
=
TRUE
;
request
->
expires
=
ft
;
}
}
}
if
(
!
expirationFound
)
...
...
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