Altered the buffering code within feedback handler so that a partial response when data has already buffered will add to the buffer.
This commit is contained in:
Родитель
1951c6673e
Коммит
a23f50a0a1
|
@ -272,10 +272,15 @@ var Feedback = function (optionArgs) {
|
|||
}
|
||||
|
||||
var processData = function(data) {
|
||||
// Need to parse this data in correct lengths;
|
||||
var pos = 0;
|
||||
// If there is some buffered data read read the remainder and process this first.
|
||||
if(readLength > 0) {
|
||||
data.copy(readBuffer, readLength, 0, 38-readLength);
|
||||
if(data.length < (responsePacketLength - readLength)) {
|
||||
data.copy(readBuffer, readLength, 0);
|
||||
readLength += data.length;
|
||||
return;
|
||||
}
|
||||
data.copy(readBuffer, readLength, 0, responsePacketLength-readLength);
|
||||
decodeResponse(readBuffer, 0);
|
||||
pos = responsePacketLength-readLength;
|
||||
readLength = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче