]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/dsi/dsi_tcp.c
Fix SIGHUP config reloading
[netatalk.git] / libatalk / dsi / dsi_tcp.c
index e06e87d92420187948611b9d044995ab158065c6..2dc5e15ddbafd72888f73d13f29db347d0ad88e1 100644 (file)
@@ -103,6 +103,24 @@ static void dsi_init_buffer(DSI *dsi)
     dsi->end = dsi->buffer + (dsi->dsireadbuf * dsi->server_quantum);
 }
 
+/*!
+ * Free any allocated ressources of the master afpd DSI objects and close server socket
+ */
+void dsi_free(DSI *dsi)
+{
+    close(dsi->serversock);
+    dsi->serversock = -1;
+
+    free(dsi->commands);
+    dsi->commands = NULL;
+
+    free(dsi->buffer);
+    dsi->buffer = NULL;
+
+    free(dsi->bonjourname);
+    dsi->bonjourname = NULL;
+}
+
 static struct itimerval itimer;
 /* accept the socket and do a little sanity checking */
 static int dsi_tcp_open(DSI *dsi)