base64 changes
This commit is contained in:
@@ -60,6 +60,13 @@ export default class connection {
|
||||
this.cleanup_handlers();
|
||||
buffer = null;
|
||||
};
|
||||
if (this.socket._socket) {
|
||||
this.socket._socket.setNoDelay(true);
|
||||
this.socket._socket.setKeepAlive(true);
|
||||
} else {
|
||||
this.socket.setNoDelay(true);
|
||||
this.socket.setKeepAlive(true);
|
||||
}
|
||||
|
||||
this.socket.on('data', (chunk) => {
|
||||
buffer = buffer ? Buffer.concat([buffer, chunk]) : chunk;
|
||||
|
||||
@@ -603,7 +603,7 @@ export const write_base64_file = async (
|
||||
response.decode_ui32(); // Service flags
|
||||
|
||||
const result = response.decode_i32();
|
||||
if (result === buffer.length) {
|
||||
if (result > 0) {
|
||||
return result;
|
||||
}
|
||||
return Promise.reject(new Error(`'write_base64_file' error: ${result}`));
|
||||
|
||||
Reference in New Issue
Block a user