Skip to content

Commit

Permalink
Merge pull request #1579 from atsign-foundation/c-daemon-haning
Browse files Browse the repository at this point in the history
fix: C daemon hanging
  • Loading branch information
XavierChanth authored Nov 28, 2024
2 parents 97f29fa + 576159f commit 0fa067e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/c/cmake/atsdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if(NOT atsdk_FOUND)
FetchContent_Declare(
atsdk
GIT_REPOSITORY https://github.com/atsign-foundation/at_c.git
GIT_TAG 6650e33ab80e9d873ede6d0213fa2999054fce7b
GIT_TAG 9b9cb315a8af08a19e9679c9dad98572536f2ee4
)
FetchContent_MakeAvailable(atsdk)
install(TARGETS atclient atchops atlogger)
Expand Down
4 changes: 4 additions & 0 deletions packages/c/sshnpd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.5

- fix: uptake some fixes in monitor

## 0.2.4

- fix: Disabled clang-tidy missing-includes, as it malformed header includes
Expand Down
2 changes: 1 addition & 1 deletion packages/c/sshnpd/include/sshnpd/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef SSHNPD_VERSION_H
#define SSHNPD_VERSION_H
#define SSHNPD_VERSION "0.2.4"
#define SSHNPD_VERSION "0.2.5"
#endif
6 changes: 5 additions & 1 deletion packages/c/sshnpd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,16 @@ void main_loop() {
// Read the next monitor message
int ret = atclient_monitor_read(&monitor_ctx, &worker, &message, &monitor_hooks);
if (ret != 0) {
atlogger_log(LOGGER_TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Possible bad state: monitor read failed\n");
atlogger_log(LOGGER_TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Possible bad state: monitor read failed (ret: %d)\n",
ret);
}

atlogger_log(LOGGER_TAG, ATLOGGER_LOGGING_LEVEL_DEBUG, "Received message of type: %d\n", message.type);

switch (message.type) {
case ATCLIENT_MONITOR_MESSAGE_TYPE_EMPTY:
// We got a timeout, nothing to read, nothing to do
break;
case ATCLIENT_MONITOR_ERROR_READ:
if (!atclient_monitor_is_connected(&monitor_ctx)) {
atlogger_log(LOGGER_TAG, ATLOGGER_LOGGING_LEVEL_ERROR,
Expand Down

0 comments on commit 0fa067e

Please sign in to comment.