base64 changes

This commit is contained in:
2021-06-06 01:51:35 -05:00
parent 806363a1c9
commit c2afa74ad8
4 changed files with 10 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
# Changelog # Changelog
## 1.3.1-r4 ## 1.3.3-r1
- Support writing base64 string data - Support writing base64 string data
## 1.3.1-r3 ## 1.3.1-r3

View File

@@ -1,6 +1,6 @@
{ {
"name": "@blockstorage/repertory-js", "name": "@blockstorage/repertory-js",
"version": "1.3.1-r4", "version": "1.3.3-r1",
"description": "A Node.js module for interfacing with Repertory's remote mount API", "description": "A Node.js module for interfacing with Repertory's remote mount API",
"author": "scott.e.graves@protonmail.com", "author": "scott.e.graves@protonmail.com",
"license": "MIT", "license": "MIT",

View File

@@ -60,6 +60,13 @@ export default class connection {
this.cleanup_handlers(); this.cleanup_handlers();
buffer = null; 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) => { this.socket.on('data', (chunk) => {
buffer = buffer ? Buffer.concat([buffer, chunk]) : chunk; buffer = buffer ? Buffer.concat([buffer, chunk]) : chunk;

View File

@@ -603,7 +603,7 @@ export const write_base64_file = async (
response.decode_ui32(); // Service flags response.decode_ui32(); // Service flags
const result = response.decode_i32(); const result = response.decode_i32();
if (result === buffer.length) { if (result > 0) {
return result; return result;
} }
return Promise.reject(new Error(`'write_base64_file' error: ${result}`)); return Promise.reject(new Error(`'write_base64_file' error: ${result}`));