@@ -115,7 +115,7 @@ void ESP8266WebServer::handleClient()
115
115
_handleRequest ();
116
116
}
117
117
118
- void ESP8266WebServer::sendHeader (String name, String value, bool first) {
118
+ void ESP8266WebServer::sendHeader (const String& name, const String& value, bool first) {
119
119
String headerLine = name;
120
120
headerLine += " : " ;
121
121
headerLine += value;
@@ -129,7 +129,7 @@ void ESP8266WebServer::sendHeader(String name, String value, bool first) {
129
129
}
130
130
}
131
131
132
- void ESP8266WebServer::send (int code, const char * content_type, String content) {
132
+ void ESP8266WebServer::send (int code, const char * content_type, const String& content) {
133
133
String response = " HTTP/1.1 " ;
134
134
response += String (code);
135
135
response += " " ;
@@ -155,15 +155,15 @@ void ESP8266WebServer::send(int code, const char* content_type, String content)
155
155
sendContent (response);
156
156
}
157
157
158
- void ESP8266WebServer::send (int code, char * content_type, String content) {
158
+ void ESP8266WebServer::send (int code, char * content_type, const String& content) {
159
159
send (code, (const char *)content_type, content);
160
160
}
161
161
162
- void ESP8266WebServer::send (int code, String content_type, String content) {
162
+ void ESP8266WebServer::send (int code, const String& content_type, const String& content) {
163
163
send (code, (const char *)content_type.c_str (), content);
164
164
}
165
165
166
- void ESP8266WebServer::sendContent (String content) {
166
+ void ESP8266WebServer::sendContent (const String& content) {
167
167
size_t size_to_send = content.length ();
168
168
size_t size_sent = 0 ;
169
169
while (size_to_send) {
0 commit comments