Skip to content

Commit 9d85d55

Browse files
authored
Merge pull request #1324 from yuumasato/ds_skip_remote_content
Allow DS session to continue without remote resources
2 parents ef16b42 + bbcbffc commit 9d85d55

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/DS/sds.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ static int ds_sds_dump_component_by_href(struct ds_sds_session *session, char* x
412412
}
413413

414414
ds_sds_session_remote_resources_progress(session)(true, "WARNING: Skipping '%s' file which is referenced from datastream\n", url);
415+
// -2 means that remote resources were not downloaded
415416
return -2;
416417
}
417418

@@ -444,8 +445,12 @@ int ds_sds_dump_component_ref_as(const xmlNodePtr component_ref, struct ds_sds_s
444445
xmlFree(xlink_href);
445446
xmlFree(cref_id);
446447

447-
if (ret != 0) {
448-
448+
if (ret == -2) {
449+
// A remote component was not dumped
450+
// It should be ok to continue without it
451+
free(target_filename_dirname);
452+
return 0;
453+
} else if (ret != 0) {
449454
free(target_filename_dirname);
450455
return -1;
451456
}

0 commit comments

Comments
 (0)