Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
0596a2ac
Commit
0596a2ac
authored
Dec 06, 2018
by
Jeroen88
Committed by
Me No Dev
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abort update if http.begin() returns false. Fix a typo in httpUpdate.ino (#2156)
parent
fe1fdd27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino
libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino
+1
-1
libraries/HTTPUpdate/src/HTTPUpdate.cpp
libraries/HTTPUpdate/src/HTTPUpdate.cpp
+12
-3
No files found.
libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino
View file @
0596a2ac
...
...
@@ -56,7 +56,7 @@ void loop() {
switch
(
ret
)
{
case
HTTP_UPDATE_FAILED
:
Serial
.
printf
(
"HTTP_UPDATE_FAILD Error (%d): %s
\n
"
,
httpUpdate
.
getLastError
(),
httpUpdate
.
getLastErrorString
().
c_str
());
Serial
.
printf
(
"HTTP_UPDATE_FAIL
E
D Error (%d): %s
\n
"
,
httpUpdate
.
getLastError
(),
httpUpdate
.
getLastErrorString
().
c_str
());
break
;
case
HTTP_UPDATE_NO_UPDATES
:
...
...
libraries/HTTPUpdate/src/HTTPUpdate.cpp
View file @
0596a2ac
...
...
@@ -49,14 +49,20 @@ HTTPUpdate::~HTTPUpdate(void)
HTTPUpdateResult
HTTPUpdate
::
update
(
WiFiClient
&
client
,
const
String
&
url
,
const
String
&
currentVersion
)
{
HTTPClient
http
;
http
.
begin
(
client
,
url
);
if
(
!
http
.
begin
(
client
,
url
))
{
return
HTTP_UPDATE_FAILED
;
}
return
handleUpdate
(
http
,
currentVersion
,
false
);
}
HTTPUpdateResult
HTTPUpdate
::
updateSpiffs
(
WiFiClient
&
client
,
const
String
&
url
,
const
String
&
currentVersion
)
{
HTTPClient
http
;
http
.
begin
(
client
,
url
);
if
(
!
http
.
begin
(
client
,
url
))
{
return
HTTP_UPDATE_FAILED
;
}
return
handleUpdate
(
http
,
currentVersion
,
true
);
}
...
...
@@ -64,7 +70,10 @@ HTTPUpdateResult HTTPUpdate::update(WiFiClient& client, const String& host, uint
const
String
&
currentVersion
)
{
HTTPClient
http
;
http
.
begin
(
client
,
host
,
port
,
uri
);
if
(
!
http
.
begin
(
client
,
host
,
port
,
uri
))
{
return
HTTP_UPDATE_FAILED
;
}
return
handleUpdate
(
http
,
currentVersion
,
false
);
}
...
...
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