Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
27983c53
Commit
27983c53
authored
Jul 25, 2011
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All dates in headers must be in UTC
parent
0cea7cb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
mongoose.c
mongoose.c
+9
-3
No files found.
mongoose.c
View file @
27983c53
...
@@ -979,6 +979,11 @@ static struct tm *localtime(const time_t *ptime, struct tm *ptm) {
...
@@ -979,6 +979,11 @@ static struct tm *localtime(const time_t *ptime, struct tm *ptm) {
return
ptm
;
return
ptm
;
}
}
static
struct
tm
*
gmtime
(
const
time_t
*
ptime
,
struct
tm
*
ptm
)
{
// FIXME(lsm): fix this.
return
localtime
(
ptime
,
ptm
);
}
static
size_t
strftime
(
char
*
dst
,
size_t
dst_size
,
const
char
*
fmt
,
static
size_t
strftime
(
char
*
dst
,
size_t
dst_size
,
const
char
*
fmt
,
const
struct
tm
*
tm
)
{
const
struct
tm
*
tm
)
{
(
void
)
snprintf
(
dst
,
dst_size
,
"implement strftime() for WinCE"
);
(
void
)
snprintf
(
dst
,
dst_size
,
"implement strftime() for WinCE"
);
...
@@ -2543,9 +2548,10 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
...
@@ -2543,9 +2548,10 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
msg
=
"Partial Content"
;
msg
=
"Partial Content"
;
}
}
// Prepare Etag, Date, Last-Modified headers
// Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to
(
void
)
strftime
(
date
,
sizeof
(
date
),
fmt
,
localtime
(
&
curtime
));
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
(
void
)
strftime
(
lm
,
sizeof
(
lm
),
fmt
,
localtime
(
&
stp
->
mtime
));
(
void
)
strftime
(
date
,
sizeof
(
date
),
fmt
,
gmtime
(
&
curtime
));
(
void
)
strftime
(
lm
,
sizeof
(
lm
),
fmt
,
gmtime
(
&
stp
->
mtime
));
(
void
)
mg_snprintf
(
conn
,
etag
,
sizeof
(
etag
),
"%lx.%lx"
,
(
void
)
mg_snprintf
(
conn
,
etag
,
sizeof
(
etag
),
"%lx.%lx"
,
(
unsigned
long
)
stp
->
mtime
,
(
unsigned
long
)
stp
->
size
);
(
unsigned
long
)
stp
->
mtime
,
(
unsigned
long
)
stp
->
size
);
...
...
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