Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
5b42b3c0
Commit
5b42b3c0
authored
Apr 20, 2021
by
Eric Duminil
Browse files
No String anymore. :)
parent
318eb864
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/web_server.cpp
View file @
5b42b3c0
...
...
@@ -262,7 +262,9 @@ namespace web_server {
}
if
(
FS_LIB
.
exists
(
csv_writer
::
filename
))
{
fs
::
File
csv_file
=
FS_LIB
.
open
(
csv_writer
::
filename
,
"r"
);
http
.
sendHeader
(
"Content-Length"
,
String
(
csv_file
.
size
()));
char
csv_size
[
10
];
snprintf
(
csv_size
,
sizeof
(
csv_size
),
"%d"
,
csv_file
.
size
());
http
.
sendHeader
(
"Content-Length"
,
csv_size
);
http
.
streamFile
(
csv_file
,
F
(
"text/csv"
));
csv_file
.
close
();
}
else
{
...
...
@@ -274,9 +276,9 @@ namespace web_server {
if
(
!
shouldBeAllowed
())
{
return
http
.
requestAuthentication
(
DIGEST_AUTH
);
}
Serial
.
print
(
"Removing CSV file..."
);
Serial
.
print
(
F
(
"Removing CSV file..."
)
)
;
FS_LIB
.
remove
(
csv_writer
::
filename
);
Serial
.
println
(
" Done!"
);
Serial
.
println
(
F
(
" Done!"
)
)
;
http
.
sendHeader
(
"Location"
,
"/"
);
http
.
send
(
303
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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