+/**
+ * Callback from MHD when a connection starts/stops
+ *
+ * @param cls closure with the `struct HTTP_Server_Plugin *`
+ * @param connection connection handle
+ * @param socket_context socket-specific pointer
+ * @param toe reason for connection notification
+ * @see #MHD_OPTION_NOTIFY_CONNECTION
+ */
+static void
+server_connection_cb (void *cls,
+ struct MHD_Connection *connection,
+ void **socket_context,
+ enum MHD_ConnectionNotificationCode toe)
+{
+ struct HTTP_Server_Plugin *plugin = cls;
+ const union MHD_ConnectionInfo *info;
+
+ if (MHD_CONNECTION_NOTIFY_STARTED == toe)
+ return;
+
+ /* Reschedule to remove closed socket from our select set */
+ info = MHD_get_connection_info (connection,
+ MHD_CONNECTION_INFO_DAEMON);
+ GNUNET_assert (NULL != info);
+ server_reschedule (plugin,
+ info->daemon,
+ GNUNET_YES);
+}
+
+