File tree Expand file tree Collapse file tree 1 file changed +1
-38
lines changed Expand file tree Collapse file tree 1 file changed +1
-38
lines changed Original file line number Diff line number Diff line change @@ -215,10 +215,6 @@ String UniversalTelegramBot::sendMultipartFormDataToTelegram(
215
215
216
216
String body;
217
217
String headers;
218
- long now;
219
- bool responseReceived = false ;
220
- bool finishedHeaders = false ;
221
- bool currentLineIsBlank = true ;
222
218
223
219
const String boundary = F (" ------------------------b8f610217e83e29b" );
224
220
@@ -319,40 +315,7 @@ String UniversalTelegramBot::sendMultipartFormDataToTelegram(
319
315
#ifdef _debug
320
316
Serial.print (" End request: " + end_request);
321
317
#endif
322
- int ch_count = 0 ;
323
- now = millis ();
324
-
325
- while (millis () - now < waitForResponse) {
326
- while (client->available ()) {
327
- char c = client->read ();
328
- responseReceived = true ;
329
-
330
- if (!finishedHeaders) {
331
- if (currentLineIsBlank && c == ' \n ' ) {
332
- finishedHeaders = true ;
333
- } else {
334
- headers += c;
335
- }
336
- } else {
337
- if (ch_count < maxMessageLength) {
338
- body += c;
339
- ch_count++;
340
- }
341
- }
342
-
343
- if (c == ' \n ' ) currentLineIsBlank = true ;
344
- else if (c != ' \r ' ) currentLineIsBlank = false ;
345
- }
346
-
347
- if (responseReceived) {
348
- #ifdef _debug
349
- Serial.println ();
350
- Serial.println (body);
351
- Serial.println ();
352
- #endif
353
- break ;
354
- }
355
- }
318
+ readHTTPAnswer (body, headers);
356
319
}
357
320
358
321
closeClient ();
You can’t perform that action at this time.
0 commit comments