Skip to content

Commit dfaa04b

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 078e882 commit dfaa04b

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

libraries/WebServer/examples/ChunkWriting/ChunkWriting.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
* This example demonstrates how to send an HTTP response using chunks
33
* It will create an HTTP Server (port 80) associated with an a MDNS service
44
* Access the HTTP server using a Web Browser:
5-
* URL can be composed using the MDNS name "esp32_chunk_resp.local"
5+
* URL can be composed using the MDNS name "esp32_chunk_resp.local"
66
* http://esp32_chunk_resp.local/
7-
* or the IP Address that will be printed out, such as for instance 192.168.1.10
7+
* or the IP Address that will be printed out, such as for instance 192.168.1.10
88
* http://192.168.1.10/
99
*
10-
* ESP32 Server response can also be viewed using the curl command:
10+
* ESP32 Server response can also be viewed using the curl command:
1111
* curl -i esp32_chunk_resp.local:80
1212
* curl -i --raw esp32_chunk_resp.local:80
1313
*/
1414

15-
1615
#include <WiFi.h>
1716
#include <NetworkClient.h>
1817
#include <WebServer.h>

libraries/WebServer/src/WebServer.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void WebServer::enableETag(bool enable, ETagFunction fn) {
551551
_eTagFunction = fn;
552552
}
553553

554-
void WebServer::chunkResponseBegin(const char* contentType) {
554+
void WebServer::chunkResponseBegin(const char *contentType) {
555555
if (_chunkedResponseActive) {
556556
log_e("Already in chunked response mode");
557557
return;
@@ -575,12 +575,11 @@ void WebServer::chunkResponseBegin(const char* contentType) {
575575
_chunkedClient = _currentClient;
576576
}
577577

578-
void WebServer::chunkWrite(const char* data, size_t length) {
579-
if (!_chunkedResponseActive)
580-
{
578+
void WebServer::chunkWrite(const char *data, size_t length) {
579+
if (!_chunkedResponseActive) {
581580
log_e("Chunked response has not been started");
582581
return;
583-
}
582+
}
584583

585584
char chunkSize[11];
586585
snprintf(chunkSize, sizeof(chunkSize), "%zx\r\n", length);
@@ -591,7 +590,7 @@ void WebServer::chunkWrite(const char* data, size_t length) {
591590
return;
592591
}
593592

594-
if (_chunkedClient.write((const uint8_t*)data, length) != length) {
593+
if (_chunkedClient.write((const uint8_t *)data, length) != length) {
595594
log_e("Failed to write chunk data");
596595
_chunkedResponseActive = false;
597596
return;
@@ -605,8 +604,7 @@ void WebServer::chunkWrite(const char* data, size_t length) {
605604
}
606605

607606
void WebServer::chunkResponseEnd() {
608-
if (!_chunkedResponseActive)
609-
{
607+
if (!_chunkedResponseActive) {
610608
log_e("Chunked response has not been started");
611609
return;
612610
}

libraries/WebServer/src/WebServer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class WebServer {
115115
const String AuthTypeDigest = F("Digest");
116116
const String AuthTypeBasic = F("Basic");
117117

118-
void chunkResponseBegin(const char* contentType = "text/plain");
119-
void chunkWrite(const char* data, size_t length);
118+
void chunkResponseBegin(const char *contentType = "text/plain");
119+
void chunkWrite(const char *data, size_t length);
120120
void chunkResponseEnd();
121121

122122
/* Callbackhandler for authentication. The extra parameters depend on the
@@ -247,7 +247,7 @@ class WebServer {
247247

248248
private:
249249
bool _chunkedResponseActive = false;
250-
NetworkClient _chunkedClient; // Store by value, no dangling pointer
250+
NetworkClient _chunkedClient; // Store by value, no dangling pointer
251251

252252
protected:
253253
virtual size_t _currentClientWrite(const char *b, size_t l) {

0 commit comments

Comments
 (0)