Skip to content

Async ota #1056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 22, 2015
Merged

Async ota #1056

merged 6 commits into from
Nov 22, 2015

Conversation

me-no-dev
Copy link
Collaborator

still up to the user to call ArduinoOTA.handle() to start the upload

@@ -70,7 +84,12 @@ void ArduinoOTAClass::begin() {
_port = 8266;
}

_udp_ota.begin(_port);
_udp_ota = new UdpContext;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to check that _udp_ota is nullptr before creating another one. If it isn't, unref it first. This could happen if someone calls begin() twice for some reason.

Also destructor is missing... Add it along with if (_udp_ota) _udp_ota->unref();. I know that ArduinoOTA is a static object now, but it's omission makes any c++ programmer weep :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a destructor :) it's empty though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. Lost it among other one-liners.

igrr added a commit that referenced this pull request Nov 22, 2015
@igrr igrr merged commit 3d26810 into esp8266:master Nov 22, 2015
@me-no-dev me-no-dev deleted the async-ota branch November 26, 2015 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants