+ result = load_url(ctx, url);
+ if (!result)
+ goto out;
+
+ rc = read_file(ctx, result->local, buf, len);
+ if (rc) {
+ pb_log("Read failed for the parser %s on file %s\n",
+ ctx->parser->name, result->local);
+ goto out_clean;
+ }
+
+ return 0;
+
+out_clean:
+ if (result->cleanup_local)
+ unlink(result->local);
+out:
+ return -1;
+}
+
+void iterate_parsers(struct discover_context *ctx)
+{
+ struct p_item* i;
+
+ pb_log("trying parsers for %s\n", ctx->device->device->id);
+
+ list_for_each_entry(&parsers, i, list) {
+ pb_debug("\ttrying parser '%s'\n", i->parser->name);
+ ctx->parser = i->parser;
+ i->parser->parse(ctx);