rxpd_connection_cmd_LOAD (int fd, short event, void* ptr)
{
struct rxpd_connection* self = (struct rxpd_connection*) ptr;
- rxpd_buffer_printf (&self->out, "#ERROR: unimplemented command %s\n", &__func__[20]);
+
+ if (!event)
+ {
+ if (self->file)
+ {
+ if (rxpd_file_load (self->file))
+ {
+ rxpd_buffer_printf (&self->out, "#OK:\n");
+ }
+ else
+ {
+ rxpd_buffer_printf (&self->out, "#ERROR: loading file '%s'\n", (const char*)self->file->node.key);
+ }
+ }
+ else
+ rxpd_buffer_printf (&self->out, "#ERROR: no such file\n");
+ close (fd);
+ }
}
void