server: Cleanly shut down senders on exit.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index fbc35e1a71c8983a5045ff8e0b7bc300f1dfb0ab..55eaf2eb0525d402dad6d3b47afb3e8b0241dad3 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -1188,3 +1188,20 @@ void vss_init(int afs_socket, struct sched *s)
                .context = vsst,
        }, s);
 }
+
+/**
+ * Turn off the virtual streaming system.
+ *
+ * This is only executed on exit. It calls the ->shutdowwn method of all senders.
+ */
+void vss_shutdown(void)
+{
+       int i;
+
+       FOR_EACH_SENDER(i) {
+               if (!senders[i]->shutdown)
+                       continue;
+               PARA_NOTICE_LOG("shutting down %s sender\n", senders[i]->name);
+               senders[i]->shutdown();
+       }
+}