-/* $OpenBSD: main.c,v 1.229 2022/12/15 12:02:29 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.230 2023/01/06 16:06:43 claudio Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
* We follow that up with whether the resources didn't parse.
*/
io_read_buf(b, &type, sizeof(type));
+ io_read_buf(b, &id, sizeof(id));
io_read_str(b, &file);
/* in filemode messages can be ignored, only the accounting matters */
goto done;
}
- io_read_buf(b, &id, sizeof(id));
rp = repo_byid(id);
repo_stat_inc(rp, type, STYPE_OK);
switch (type) {
case RTYPE_FILE:
break;
default:
- errx(1, "unknown entity type %d", type);
+ warnx("%s: unknown entity type %d", file, type);
+ break;
}
done:
-/* $OpenBSD: parser.c,v 1.81 2022/12/15 12:02:29 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.82 2023/01/06 16:06:43 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
/* pass back at least type, repoid and filename */
b = io_new_buffer();
io_simple_buffer(b, &entp->type, sizeof(entp->type));
+ io_simple_buffer(b, &entp->repoid, sizeof(entp->repoid));
file = NULL;
f = NULL;
switch (entp->type) {
case RTYPE_TAL:
io_str_buffer(b, entp->file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
if ((tal = tal_parse(entp->file, entp->data,
entp->datasz)) == NULL)
errx(1, "%s: could not parse tal file",
case RTYPE_CER:
file = parse_load_file(entp, &f, &flen);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
if (entp->data != NULL)
cert = proc_parser_root_cert(file,
f, flen, entp->data, entp->datasz,
file = parse_filepath(entp->repoid, entp->path,
entp->file, entp->location);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
break;
case RTYPE_MFT:
file = proc_parser_mft(entp, &mft);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
c = (mft != NULL);
io_simple_buffer(b, &c, sizeof(int));
if (mft != NULL)
case RTYPE_ROA:
file = parse_load_file(entp, &f, &flen);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
roa = proc_parser_roa(file, f, flen);
c = (roa != NULL);
io_simple_buffer(b, &c, sizeof(int));
case RTYPE_GBR:
file = parse_load_file(entp, &f, &flen);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
proc_parser_gbr(file, f, flen);
break;
case RTYPE_ASPA:
file = parse_load_file(entp, &f, &flen);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
aspa = proc_parser_aspa(file, f, flen);
c = (aspa != NULL);
io_simple_buffer(b, &c, sizeof(int));
case RTYPE_TAK:
file = parse_load_file(entp, &f, &flen);
io_str_buffer(b, file);
- io_simple_buffer(b, &entp->repoid,
- sizeof(entp->repoid));
proc_parser_tak(file, f, flen);
break;
default:
- errx(1, "unhandled entity type %d", entp->type);
+ file = parse_filepath(entp->repoid, entp->path,
+ entp->file, entp->location);
+ io_str_buffer(b, file);
+ warnx("%s: unhandled type %d", file, entp->type);
+ break;
}
free(f);