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
56f661e9
Commit
56f661e9
authored
Sep 23, 2015
by
Marko Mikulicic
Committed by
Sergey Lyubka
Sep 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make mg send_http_file work for ESP8266 RTOS
PUBLISHED_FROM=10623cfe38e143f7e107a6494baa298c788586f0
parent
5351f46e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
mongoose.c
mongoose.c
+10
-7
No files found.
mongoose.c
View file @
56f661e9
...
...
@@ -4447,19 +4447,22 @@ static void mg_send_http_file2(struct mg_connection *nc, const char *path,
gmt_time_string
(
current_time
,
sizeof
(
current_time
),
&
t
);
gmt_time_string
(
last_modified
,
sizeof
(
last_modified
),
&
st
->
st_mtime
);
mime_type
=
get_mime_type
(
path
,
"text/plain"
,
opts
);
/*
* breaking up printing in three separate mg_printf invocations
* otherwise crashes inside newlib on ESP8266.
* Not a big performance penalty on desktop.
*/
mg_printf
(
nc
,
"HTTP/1.1 %d %s
\r\n
"
"Date: %s
\r\n
"
"Last-Modified: %s
\r\n
"
"Accept-Ranges: bytes
\r\n
"
"Content-Type: %.*s
\r\n
"
"Content-Length: %"
INT64_FMT
"
\r\n
"
"%s"
"Etag: %s
\r\n
"
"
\r\n
"
,
"Content-Type: %.*s
\r\n
"
,
status_code
,
status_message
,
current_time
,
last_modified
,
(
int
)
mime_type
.
len
,
mime_type
.
p
,
cl
,
range
,
etag
);
(
int
)
mime_type
.
len
,
mime_type
.
p
);
mg_printf
(
nc
,
"Content-Length: %"
INT64_FMT
"
\r\n
"
,
cl
);
mg_printf
(
nc
,
"%sEtag: %s
\r\n\r\n
"
,
range
,
etag
);
nc
->
proto_data
=
(
void
*
)
dp
;
dp
->
cl
=
cl
;
dp
->
type
=
DATA_FILE
;
...
...
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