Skip to content

Commit 3981b18

Browse files
author
Jeroen88
committed
Fix Travis formatting issue for example ReuseConnectionV2.ino
1 parent 62e6282 commit 3981b18

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,30 @@ void setup() {
4747
}
4848

4949
void loop() {
50-
for(int i = 0; i < 10; i++) {
51-
Serial.printf("Reuse connection example, GET url for the %d time\n", i + 1);
52-
int httpCode = http.GET();
53-
if (httpCode > 0) {
54-
Serial.printf("[HTTP] GET... code: %d\n", httpCode);
55-
56-
// file found at server
57-
if (httpCode == HTTP_CODE_OK) {
58-
http.writeToStream(&Serial);
59-
}
60-
} else {
61-
Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
62-
// Something went wrong with the connection, try to reconnect
63-
http.end();
64-
http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
65-
//http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
66-
}
67-
68-
Serial.println("\n\n\nWait 5 second...\n");
69-
delay(5000);
50+
for(int i = 0; i < 10; i++) {
51+
Serial.printf("Reuse connection example, GET url for the %d time\n", i + 1);
52+
int httpCode = http.GET();
53+
if (httpCode > 0) {
54+
Serial.printf("[HTTP] GET... code: %d\n", httpCode);
55+
56+
// file found at server
57+
if (httpCode == HTTP_CODE_OK) {
58+
http.writeToStream(&Serial);
59+
}
60+
} else {
61+
Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
62+
// Something went wrong with the connection, try to reconnect
63+
http.end();
64+
http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
65+
//http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
7066
}
7167

72-
http.end();
68+
Serial.println("\n\n\nWait 5 second...\n");
69+
delay(5000);
70+
}
71+
72+
http.end();
7373

74-
Serial.println("Done testing, now wait forever");
75-
for(;;) delay(100); // Wait forever
74+
Serial.println("Done testing, now wait forever");
75+
for(;;) delay(100); // Wait forever
7676
}

0 commit comments

Comments
 (0)