fix converting 0xa to 10(dec)

Revert "use my AsyncTCP fork"

This reverts commit b956d154a9725bc8a464a7325df9cae71d82144a.

use my AsyncTCP fork
This commit is contained in:
Tarik2142
2024-12-13 17:14:10 +02:00
committed by Mathieu Carbou
parent e031d27874
commit 8f442910f0

View File

@@ -23,6 +23,8 @@
#endif
#include "AsyncEventSource.h"
#define ASYNC_SSE_NEW_LINE_CHAR (char)0xa
using namespace asyncsrv;
static String generateEventMessage(const char* message, const char* event, uint32_t id, uint32_t reconnect) {
@@ -41,19 +43,19 @@ static String generateEventMessage(const char* message, const char* event, uint3
if (reconnect) {
str += T_retry_;
str += reconnect;
str += (char)0xa; // '\n'
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
}
if (id) {
str += T_id__;
str += id;
str += (char)0xa; // '\n'
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
}
if (event != NULL) {
str += T_event_;
str += event;
str += (char)0xa; // '\n'
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
}
if (!message)
@@ -95,13 +97,13 @@ static String generateEventMessage(const char* message, const char* event, uint3
str += T_data_;
str.concat(lineStart, lineEnd - lineStart);
str += 0xa; // \n
str += ASYNC_SSE_NEW_LINE_CHAR; // \n
lineStart = nextLine;
} while (lineStart < ((char*)message + messageLen));
// append another \n to terminate message
str += 0xa; // '\n'
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
return str;
}