DELETE command
[rxpd] / src / rxpd_connection_cmd.c
index 7e446c0..9008ec2 100644 (file)
@@ -314,6 +314,23 @@ rxpd_connection_cmd_SAVE (int fd, short event, void* ptr)
     }
 }
 
+void
+rxpd_connection_cmd_DELETE (int fd, short event, void* ptr)
+{
+  (void) fd;
+  struct rxpd_connection* self = (struct rxpd_connection*) ptr;
+
+  if (!event)
+    {
+      if (self->file)
+        {
+          rxpd_file_delete (self->file);
+          rxpd_buffer_printf (&self->out, "#OK:\n");
+        }
+      rxpd_connection_delete (self);
+    }
+}
+
 void
 rxpd_connection_cmd_DUMP (int fd, short event, void* ptr)
 {