Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
1112981e
Commit
1112981e
authored
Nov 17, 2015
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mg_if_not_modified() logic
PUBLISHED_FROM=3eb1455eacc66af83904f56397c0e24b1d4f13bf
parent
0cf82744
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
mongoose.c
mongoose.c
+12
-7
No files found.
mongoose.c
View file @
1112981e
...
@@ -103,6 +103,7 @@ MG_INTERNAL size_t mg_handle_chunked(struct mg_connection *nc,
...
@@ -103,6 +103,7 @@ MG_INTERNAL size_t mg_handle_chunked(struct mg_connection *nc,
#ifndef MG_DISABLE_FILESYSTEM
#ifndef MG_DISABLE_FILESYSTEM
MG_INTERNAL
time_t
mg_parse_date_string
(
const
char
*
datetime
);
MG_INTERNAL
time_t
mg_parse_date_string
(
const
char
*
datetime
);
MG_INTERNAL
int
mg_is_not_modified
(
struct
http_message
*
hm
,
cs_stat_t
*
st
);
#endif
#endif
/* Forward declarations for testing. */
/* Forward declarations for testing. */
...
@@ -5981,13 +5982,17 @@ MG_INTERNAL time_t mg_parse_date_string(const char *datetime) {
...
@@ -5981,13 +5982,17 @@ MG_INTERNAL time_t mg_parse_date_string(const char *datetime) {
return
result
;
return
result
;
}
}
static
int
mg_is_not_modified
(
struct
http_message
*
hm
,
cs_stat_t
*
st
)
{
MG_INTERNAL
int
mg_is_not_modified
(
struct
http_message
*
hm
,
cs_stat_t
*
st
)
{
char
etag
[
64
];
struct
mg_str
*
hdr
;
struct
mg_str
*
ims
=
mg_get_http_header
(
hm
,
"If-Modified-Since"
);
if
((
hdr
=
mg_get_http_header
(
hm
,
"If-None-Match"
))
!=
NULL
)
{
struct
mg_str
*
inm
=
mg_get_http_header
(
hm
,
"If-None-Match"
);
char
etag
[
64
];
construct_etag
(
etag
,
sizeof
(
etag
),
st
);
construct_etag
(
etag
,
sizeof
(
etag
),
st
);
return
(
inm
!=
NULL
&&
!
mg_vcasecmp
(
inm
,
etag
))
||
return
mg_vcasecmp
(
hdr
,
etag
)
==
0
;
(
ims
!=
NULL
&&
st
->
st_mtime
<=
mg_parse_date_string
(
ims
->
p
));
}
else
if
((
hdr
=
mg_get_http_header
(
hm
,
"If-Modified-Since"
))
!=
NULL
)
{
return
st
->
st_mtime
<=
mg_parse_date_string
(
hdr
->
p
);
}
else
{
return
0
;
}
}
}
static
void
mg_send_digest_auth_request
(
struct
mg_connection
*
c
,
static
void
mg_send_digest_auth_request
(
struct
mg_connection
*
c
,
...
...
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