]> git.ozlabs.org Git - petitboot/blobdiff - discover/discover-server.c
utils/hooks: Set linux,stdout-path for primary console
[petitboot] / discover / discover-server.c
index 3cf9facc07ff700d6d4e4d30b42c0a9271591344..5f6f4d5190422aa257db6f2f7cbbce6cf887e654 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "device-handler.h"
 #include "discover-server.h"
+#include "platform.h"
 #include "sysinfo.h"
 
 struct discover_server {
@@ -215,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);
@@ -244,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);
 
@@ -257,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;
@@ -273,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;