diff options
| author | Enrique | 2025-04-07 22:52:25 +0200 |
|---|---|---|
| committer | Enrique | 2025-04-07 22:52:25 +0200 |
| commit | d2ba110a8cc15ab4b967296cc02715f9c6e3cf21 (patch) | |
| tree | 1fcb2c086ebf6706bd9abe0963d881a5d25d276f | |
| parent | 944d396ef0bca53f057d6eee49f9305d8d30e910 (diff) | |
| download | soikk-server-d2ba110a8cc15ab4b967296cc02715f9c6e3cf21.tar.xz soikk-server-d2ba110a8cc15ab4b967296cc02715f9c6e3cf21.tar.zst | |
fixed bug where not all of the ack was compared in the ipc module
| -rwxr-xr-x | src/ipc/ipc.c | 2 | ||||
| -rwxr-xr-x | src/worker.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index c23af9a..73adb32 100755 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -91,7 +91,7 @@ int send_ipc_message(int to, ipc_type type, str msg){ log_error("Receiving ACK from listener"); return 1; } - if(strncmp(ack, "ACK", 2) != 0){ + if(strncmp(ack, "ACK", 3) != 0){ log_error("Received '%.3s' from listener instead of 'ACK'", ack); return 1; } diff --git a/src/worker.c b/src/worker.c index 51ff976..c6384d0 100755 --- a/src/worker.c +++ b/src/worker.c @@ -14,6 +14,7 @@ str certfile; str keyfile; +// make int for errors? void handle_message(ipc_msg im){ switch(im.type){ case NONE: break; @@ -35,10 +36,10 @@ void handle_message(ipc_msg im){ keyfile = dup_str(im.msg); break; case RESTART: - char *args[] = {"./worker.exe", listener.saddr.ptr, NULL}; + char *args[] = {"./worker.exe", listener->saddr.ptr, NULL}; execv("./worker.exe", args); log_error("Cannot restart worker: %s", strerror(errno)); - return 1; + return; break; case RELOAD: // re-reads config |
