Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 8f44291

Browse files
Tarik2142mathieucarbou
authored andcommitted
fix converting 0xa to 10(dec)
Revert "use my AsyncTCP fork" This reverts commit b956d15. use my AsyncTCP fork
1 parent e031d27 commit 8f44291

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/AsyncEventSource.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#endif
2424
#include "AsyncEventSource.h"
2525

26+
#define ASYNC_SSE_NEW_LINE_CHAR (char)0xa
27+
2628
using namespace asyncsrv;
2729

2830
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
4143
if (reconnect) {
4244
str += T_retry_;
4345
str += reconnect;
44-
str += (char)0xa; // '\n'
46+
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
4547
}
4648

4749
if (id) {
4850
str += T_id__;
4951
str += id;
50-
str += (char)0xa; // '\n'
52+
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
5153
}
5254

5355
if (event != NULL) {
5456
str += T_event_;
5557
str += event;
56-
str += (char)0xa; // '\n'
58+
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
5759
}
5860

5961
if (!message)
@@ -95,13 +97,13 @@ static String generateEventMessage(const char* message, const char* event, uint3
9597

9698
str += T_data_;
9799
str.concat(lineStart, lineEnd - lineStart);
98-
str += 0xa; // \n
100+
str += ASYNC_SSE_NEW_LINE_CHAR; // \n
99101

100102
lineStart = nextLine;
101103
} while (lineStart < ((char*)message + messageLen));
102104

103105
// append another \n to terminate message
104-
str += 0xa; // '\n'
106+
str += ASYNC_SSE_NEW_LINE_CHAR; // '\n'
105107

106108
return str;
107109
}

0 commit comments

Comments
 (0)