char **pxe_conf_files, **filename;
struct pb_url *conf_url, *url;
struct conf_context *conf;
+ bool complete_url;
int len, rc;
char *buf;
parser_info = talloc_zero(conf, struct pxe_parser_info);
conf->parser_info = parser_info;
- conf_url = user_event_parse_conf_url(dc, dc->event);
+ conf_url = user_event_parse_conf_url(dc, dc->event, &complete_url);
if (!conf_url)
goto out_conf;
- if (dc->conf_url) {
+ if (complete_url) {
+ /* we have a complete URL; use this and we're done. */
+ dc->conf_url = conf_url;
rc = parser_request_url(dc, dc->conf_url, &buf, &len);
if (rc)
goto out_conf;
}
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
- struct event *event)
+ struct event *event, bool *is_complete)
{
const char *conffile, *host, *bootfile;
char *p, *basedir, *url_str;
talloc_free(url_str);
}
- ctx->conf_url = url;
+ *is_complete = true;
} else {
host = parse_host_addr(event);
if (!host) {
talloc_free(url_str);
talloc_free(basedir);
+ *is_complete = false;
}
return url;
#if !defined(_PB_DISCOVER_USER_EVENT_H)
#define _PB_DISCOVER_USER_EVENT_H
+#include <stdbool.h>
+
#include "device-handler.h"
#define PBOOT_USER_EVENT_SOCKET "/tmp/petitboot.ev"
struct waitset;
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
- struct event *event);
+ struct event *event, bool *complete_url);
char **user_event_parse_conf_filenames(
struct discover_context *ctx, struct event *event);
struct user_event *user_event_init(struct waitset *waitset,