Skip to content

Commit

Permalink
Update TCP parse loop to current paradigm
Browse files Browse the repository at this point in the history
Extend previous OWM fix to all occurrences of the same parse loop pattern.
  • Loading branch information
marcelstoer committed Oct 20, 2018
1 parent faf1f22 commit dddb014
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/PlaneSpotterDemo/AdsbExchangeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void AdsbExchangeClient::updateVisibleAircraft(String searchQuery) {

int size = 0;
client.setNoDelay(false);
while(client.connected()) {
while(client.available() || client.connected()) {
while((size = client.available()) > 0) {
c = client.read();
if (c == '{' || c == '[') {
Expand Down
2 changes: 1 addition & 1 deletion src/AerisForecasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void AerisForecasts::doUpdate(AerisForecastData *forecasts, String url, uint8_t

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
if ((millis() - lost_do) > lostTest) {
Serial.println ("lost in client with a timeout");
Expand Down
2 changes: 1 addition & 1 deletion src/AerisObservations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void AerisObservations::doUpdate(AerisObservationsData *observations, String url

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
if ((millis() - lost_do) > lostTest) {
Serial.println ("lost in client with a timeout");
Expand Down
2 changes: 1 addition & 1 deletion src/AerisSunMoon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void AerisSunMoon::doUpdate(AerisSunMoonData *sunMoonData, String url) {

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
if ((millis() - lost_do) > lostTest) {
Serial.println ("lost in client with a timeout");
Expand Down
2 changes: 1 addition & 1 deletion src/ThingspeakClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ThingspeakClient::getLastChannelItem(String channelId, String readApiKey) {

int size = 0;
client.setNoDelay(false);
while(client.connected()) {
while(client.available() || client.connected()) {
while((size = client.available()) > 0) {
c = client.read();
if (c == '{' || c == '[') {
Expand Down
2 changes: 1 addition & 1 deletion src/TimeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void TimeClient::updateTime() {

int size = 0;
client.setNoDelay(false);
while(client.connected()) {
while(client.available() || client.connected()) {
while((size = client.available()) > 0) {
line = client.readStringUntil('\n');
line.toUpperCase();
Expand Down
2 changes: 1 addition & 1 deletion src/WorldClockClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void WorldClockClient::updateTime() {

int size = 0;
client.setNoDelay(false);
while(client.connected()) {
while(client.available() || client.connected()) {
while((size = client.available()) > 0) {
c = client.read();
if (c == '{' || c == '[') {
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundAlerts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void WundergroundAlerts::doUpdate(WGAlert *alerts, uint8_t maxAlerts, String url

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
c = client->read();
if (c == '{' || c == '[') {
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundAstronomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void WundergroundAstronomy::doUpdate(WGAstronomy *astronomy, String url) {

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
c = client->read();
if (c == '{' || c == '[') {
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void WundergroundClient::doUpdate(String url) {
parser.parse(c);
}
}
} while(client.connected());
} while(client.available() || client.connected());
}

void WundergroundClient::whitespace(char c) {
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundConditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void WundergroundConditions::doUpdate(WGConditions *conditions, String url) {

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
if ((millis() - lost_do) > lostTest) {
Serial.println ("lost in client with a timeout");
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundForecast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void WundergroundForecast::doUpdate(WGForecast *forecasts, uint8_t maxForecasts,

WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
if ((millis() - lost_do) > lostTest) {
Serial.println ("lost in client with a timeout");
Expand Down
2 changes: 1 addition & 1 deletion src/WundergroundHourly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void WundergroundHourly::doUpdate(WGHourly *hourlies, String url) {
if(httpCode > 0) {
WiFiClient * client = http.getStreamPtr();

while(client->connected()) {
while(client->available() || client->connected()) {
while((size = client->available()) > 0) {
c = client->read();
if (c == '{' || c == '[') {
Expand Down

0 comments on commit dddb014

Please sign in to comment.