Skip to content

Commit

Permalink
Merge pull request #49 from thenetrunna/master
Browse files Browse the repository at this point in the history
fix node memory error when viewing resource
  • Loading branch information
thenetrunna authored Nov 27, 2023
2 parents 8e592b9 + 2399d62 commit b73a50b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/node/default-node-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ host = "127.0.0.1"
port = 6961

[peers]
bootstrap_peers = ["https://shoggoth.network"]
bootstrap_peers = ["http://shoggoth.network:6969"]

[explorer]
enable = true
Expand Down
2 changes: 0 additions & 2 deletions src/node/server/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ void api_download_route(sonic_server_request_t *req) {

resource_name[strlen(resource_name) - 4] = '\0';

LOG(INFO, "RES: %s", resource_name);

if (strlen(shoggoth_id) != 36) {
respond_error(req, "invalid Shoggoth ID");

Expand Down
8 changes: 4 additions & 4 deletions src/node/server/server_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void profile_resource_route(sonic_server_request_t *req) {
malloc((strlen(shoggoth_id) + strlen(resource_group_str) +
strlen(resource_name) + strlen(shoggoth_id) +
strlen(main_content) + strlen(tabs_str) +
strlen(download_link) + strlen(resource_size_str) + 1 + 128) *
strlen(download_link) + strlen(resource_size_str) + 1 + 256) *
sizeof(char));

sprintf(template_data,
Expand All @@ -418,9 +418,9 @@ void profile_resource_route(sonic_server_request_t *req) {
} else {
template_data =
malloc((strlen(shoggoth_id) + strlen(resource_group_str) +
strlen(resource_name) + strlen(shoggoth_id) +
strlen(main_content) + strlen(tabs_str) +
strlen(download_link) + strlen(resource_size_str) + 1 + 128) *
strlen(resource_name) + strlen(inner_path) +
strlen(shoggoth_id) + strlen(main_content) + strlen(tabs_str) +
strlen(download_link) + strlen(resource_size_str) + 1 + 256) *
sizeof(char));

sprintf(template_data,
Expand Down

0 comments on commit b73a50b

Please sign in to comment.