X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdiscover-server.c;h=ad184f66a43559fcc78707b7aa69c204bfec69f2;hp=1765074ecd675038ddc75bf3bc997f4951b925cb;hb=b5f9e34d85075afe7aa87b5ce4a1a2d911468e36;hpb=c14b12980885edd035322cd3bc87efff444c39b1 diff --git a/discover/discover-server.c b/discover/discover-server.c index 1765074..ad184f6 100644 --- a/discover/discover-server.c +++ b/discover/discover-server.c @@ -157,7 +157,7 @@ static int write_device_remove_message(struct discover_server *server, } static int write_boot_status_message(struct discover_server *server, - struct client *client, const struct boot_status *status) + struct client *client, const struct status *status) { struct pb_protocol_message *message; int len; @@ -216,6 +216,7 @@ static int discover_server_process_message(void *arg) struct boot_command *boot_command; struct client *client = arg; struct config *config; + char *url; int rc; message = pb_protocol_read_message(client, client->fd); @@ -245,6 +246,10 @@ static int discover_server_process_message(void *arg) device_handler_cancel_default(client->server->device_handler); break; + case PB_PROTOCOL_ACTION_REINIT: + device_handler_reinit(client->server->device_handler); + break; + case PB_PROTOCOL_ACTION_CONFIG: config = talloc_zero(client, struct config); @@ -258,6 +263,13 @@ static int discover_server_process_message(void *arg) config); break; + case PB_PROTOCOL_ACTION_ADD_URL: + url = pb_protocol_deserialise_string((void *) client, message); + + device_handler_process_url(client->server->device_handler, + url, NULL, NULL); + break; + default: pb_log("%s: invalid action %d\n", __func__, message->action); return 0; @@ -274,7 +286,7 @@ static int discover_server_process_connection(void *arg) struct client *client; /* accept the incoming connection */ - fd = accept(server->socket, NULL, 0); + fd = accept(server->socket, NULL, NULL); if (fd < 0) { pb_log("accept: %s\n", strerror(errno)); return 0; @@ -354,7 +366,7 @@ void discover_server_notify_device_remove(struct discover_server *server, } void discover_server_notify_boot_status(struct discover_server *server, - struct boot_status *status) + struct status *status) { struct client *client;