Fix a handful of errors and warnings I've seen. Gets further running in docker, now.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3773 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-01-17 21:46:32 +00:00
parent e9e1a3e80d
commit c864041fa0
5 changed files with 11 additions and 5 deletions

View File

@ -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"]

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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)