peer-term 1.4.9 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/viewer.js +7 -7
package/package.json
CHANGED
package/src/viewer.js
CHANGED
|
@@ -107,13 +107,6 @@ export class ViewerServer {
|
|
|
107
107
|
// Install the real data handler
|
|
108
108
|
let recvBuf = '';
|
|
109
109
|
|
|
110
|
-
// Process any leftover data that arrived after the token line
|
|
111
|
-
if (remaining.length > 0) {
|
|
112
|
-
handleViewerData(remaining);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
socket.on('data', (chunk) => handleViewerData(chunk.toString()));
|
|
116
|
-
|
|
117
110
|
const handleViewerData = (chunk) => {
|
|
118
111
|
// Control messages start with \x00{
|
|
119
112
|
if (recvBuf.length > 0 || chunk.startsWith('\x00{')) {
|
|
@@ -149,6 +142,13 @@ export class ViewerServer {
|
|
|
149
142
|
this._onKeystroke(chunk);
|
|
150
143
|
};
|
|
151
144
|
|
|
145
|
+
// Process any leftover data that arrived after the token line
|
|
146
|
+
if (remaining.length > 0) {
|
|
147
|
+
handleViewerData(remaining);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
socket.on('data', (chunk) => handleViewerData(chunk.toString()));
|
|
151
|
+
|
|
152
152
|
socket.on('close', () => {
|
|
153
153
|
this._socket = null;
|
|
154
154
|
this._logDebug('Host viewer disconnected.');
|