You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The initial design of the library was doing a backup of the byte following the data buffer because the client code
663
-
// was allowed and documented to do something like data[len] = 0; to facilitate null-terminated string handling.
664
-
// This was a bit hacky but it was working and it was documented, although completely incorrect because it was modifying a byte outside of the data buffer.
665
-
// So to fix this behavior and to avoid breaking existing client code that may be relying on this behavior, we now have to copy the data to a temporary buffer that has an extra byte for the null terminator.
// The initial design of the library was doing a backup of the byte following the data buffer because the client code
734
-
// was allowed and documented to do something like data[len] = 0; to facilitate null-terminated string handling.
735
-
// This was a bit hacky but it was working and it was documented, although completely incorrect because it was modifying a byte outside of the data buffer.
736
-
// So to fix this behavior and to avoid breaking existing client code that may be relying on this behavior, we now have to copy the data to a temporary buffer that has an extra byte for the null terminator.
// The initial design of the library was doing a backup of the byte following the data buffer because the client code
739
+
// was allowed and documented to do something like data[len] = 0; to facilitate null-terminated string handling.
740
+
// This was a bit hacky but it was working and it was documented, although completely incorrect because it was modifying a byte outside of the data buffer.
741
+
// So to fix this behavior and to avoid breaking existing client code that may be relying on this behavior, we now have to copy the data to a temporary buffer that has an extra byte for the null terminator.
Copy file name to clipboardExpand all lines: src/AsyncWebSocket.h
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,9 @@ class AsyncWebSocketClient {
236
236
void_runQueue();
237
237
void_clearQueue();
238
238
239
+
// this function is called when a text message is received, in order to copy the buffer and place a null terminator at the end of the buffer for easier handling of text messages.
0 commit comments