jmuehlner commented on code in PR #455:
URL: https://github.com/apache/guacamole-server/pull/455#discussion_r1305951003


##########
src/guacd/daemon.c:
##########
@@ -245,6 +246,49 @@ static void guacd_openssl_free_locks(int count) {
 #endif
 #endif
 
+/**
+ * A flag that, if non-zero, indicates that the daemon should immediately stop
+ * accepting new connections.
+ */
+int stop_everything = 0;
+
+/**
+ * A signal handler that will set a flag telling the daemon to immediately stop
+ * accepting new connections. Note that the signal itself will cause any 
pending
+ * accept() calls to be interrupted, causing the daemon to unlock and begin
+ * cleaning up.
+ *
+ * @param signal
+ *     The signal that was received. Unused in this function since only
+ *     signals that should result in stopping the daemon should invoke this.
+ */
+static void signal_stop_handler(int signal) {

Review Comment:
   These various signal handling mechanisms are to ensure that the daemon and 
associated child processes will definitely stop, even if one of the children is 
locked up due to deadlock or similar.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to