- rc = read_file(ctx, path, &buf, &len);
- if (!rc) {
- parser->parse(ctx, buf, len);
- talloc_free(buf);
- }
+int parser_request_url(struct discover_context *ctx, struct pb_url *url,
+ char **buf, int *len)
+{
+ struct load_url_result *result;
+ int rc;
+
+ 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;