Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

HTTPSClient::connected() hang when _sslClient is NULL #22

Closed
yaweiw opened this issue Aug 2, 2016 · 5 comments
Closed

HTTPSClient::connected() hang when _sslClient is NULL #22

yaweiw opened this issue Aug 2, 2016 · 5 comments

Comments

@yaweiw
Copy link
Contributor

yaweiw commented Aug 2, 2016

uint8_t HTTPSClient::connected()
{
return _sslClient->connected();
}
when _sslClient is null, HTTPSClient::connected() hangs indefinitely. This doesn't seem right. Can we have some notification via e.g. serial port rather than completely unresponsive?

@sandeepmistry
Copy link
Contributor

Hi @yaweiw,

We can definitely add a NULL check for prevent it crashing. Could you please share an example sketch and steps to reproduce the issue. I'm curious as to how you are encountering this issue.

uint8_t HTTPSClient::connected()
{
  return (_sslClient ? _sslClient->connected() : false);
}

@yaweiw
Copy link
Contributor Author

yaweiw commented Aug 12, 2016

@sandeepmistry it can easily be reproduced by not having below lines in your ino file.
Adafruit_WINC1500SSLClient sslClient;
AzureIoTHubClient iotHubClient(sslClient);

@sandeepmistry
Copy link
Contributor

I think a better fix is changing HTTPAPI_Init in src/httpapi.cpp to fail the SSL client is NULL and logging an error.

Would you have time to submit a PR for this?

@yaweiw
Copy link
Contributor Author

yaweiw commented Aug 12, 2016

@sandeepmistry Ok. I'll have a look later.

yaweiw added a commit to yaweiw/AzureIoTHub that referenced this issue Aug 15, 2016
@sandeepmistry
Copy link
Contributor

Closed via #24.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants