diff --git a/Dockerfile b/Dockerfile index 4478fa32..8b05f1fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,4 @@ COPY --from=build /app/apps /app/apps COPY --from=build /app/core /app/core WORKDIR /app EXPOSE 12345 -CMD ["/app/out/release/tildefriends"] +ENTRYPOINT ["/app/out/release/tildefriends"] diff --git a/core/app.js b/core/app.js index 2b830d11..c90b96fc 100644 --- a/core/app.js +++ b/core/app.js @@ -60,7 +60,6 @@ function socket(request, response, client) { blobId = await new Database(user).get('path:' + path); if (!blobId) { response.send(JSON.stringify({action: "error", error: message.path + ' not found'}), 0x1); - request.close(); } } response.send(JSON.stringify({action: "session", credentials: credentials}), 0x1); diff --git a/core/client.js b/core/client.js index 11c46d17..30472fc6 100644 --- a/core/client.js +++ b/core/client.js @@ -422,7 +422,11 @@ function receive(message) { } else if (message && message.action == "ping") { gSocket.send(JSON.stringify({action: "pong"})); } else if (message && message.action == "error") { - setStatusMessage(message.error.message + '\n' + message.error.stack, '#f00', false); + if (typeof(message.error) == 'string') { + setStatusMessage(message.error, '#f00', false); + } else { + setStatusMessage(message.error.message + '\n' + message.error.stack, '#f00', false); + } console.log(message.error); } } diff --git a/core/core.js b/core/core.js index 49793fd7..38faed93 100644 --- a/core/core.js +++ b/core/core.js @@ -546,7 +546,7 @@ async function loadSettings() { gGlobalSettings = JSON.parse(data); } } catch (error) { - print("Error loading settings from " + kGlobalSettingsFile + ": " + error); + print("Error loading settings from " + kGlobalSettingsFile + ":", error); } } diff --git a/src/ssb.db.c b/src/ssb.db.c index 8ba52fdf..41bcb20d 100644 --- a/src/ssb.db.c +++ b/src/ssb.db.c @@ -192,7 +192,10 @@ bool tf_ssb_db_blob_get(tf_ssb_t* ssb, const char* id, uint8_t** out_blob, size_ if (out_blob) { *out_blob = malloc(size + 1); - memcpy(*out_blob, blob, size); + if (size) + { + memcpy(*out_blob, blob, size); + } (*out_blob)[size] = '\0'; } if (out_size)