Address more feedback, minor cleanup

This commit is contained in:
Henrik Rydgård 2023-07-21 10:27:31 +02:00
parent ae354a7639
commit 9decdd198e
3 changed files with 5 additions and 6 deletions

View File

@ -70,7 +70,8 @@ bool HTTPSDownload::Done() {
return false;
}
resultCode_ = naettGetStatus(res_);
// -1000 is a code specified by us to represent cancellation, that is unlikely to ever collide with naett error codes.
resultCode_ = IsCancelled() ? -1000 : naettGetStatus(res_);
if (resultCode_ < 0) {
// It's a naett error. Translate and handle.
switch (resultCode_) {
@ -86,7 +87,7 @@ bool HTTPSDownload::Done() {
case naettWriteError: // -4
ERROR_LOG(IO, "Write error");
break;
case naettGenericError: // -4
case naettGenericError: // -5
ERROR_LOG(IO, "Generic error");
break;
default:

View File

@ -49,8 +49,6 @@ std::recursive_mutex upnpLock;
std::deque<UPnPArgs> upnpReqs;
PortManager::PortManager():
urls(0),
datas(0),
m_InitState(UPNP_INITSTATE_NONE),
m_LocalPort(UPNP_LOCAL_PORT_ANY),
m_leaseDuration("43200") {

View File

@ -108,8 +108,8 @@ private:
// Uninitialize/Reset the state
void Terminate();
struct UPNPUrls* urls = NULL;
struct IGDdatas* datas = NULL;
struct UPNPUrls* urls = nullptr;
struct IGDdatas* datas = nullptr;
int m_InitState = UPNP_INITSTATE_NONE;
int m_LocalPort = UPNP_LOCAL_PORT_ANY;