Skip to content

Commit

Permalink
Harvester / CSW / Infinite loop #1355.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Dec 15, 2015
1 parent e121742 commit 92f8a77
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,12 @@ private Set<RecordInfo> search(CswServer server, Search s) throws Exception {
log.warning("Declared number of returned records (" + returnedCount + ") does not match actual record count (" + foundCnt + ")");
}


// As indicated in CSW: A value of 0 means all records have been returned.
if (nextRecord == 0) {
// And in case the CSW does not advertised the correct nextRecord
// check that we do not try to go over the last page.
if (nextRecord == 0 ||
start + GETRECORDS_REQUEST_MAXRECORDS > matchedCount) {
break;
}

Expand Down

1 comment on commit 92f8a77

@etj
Copy link
Member

@etj etj commented on 92f8a77 Jan 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will make the harvester end its work earlier if the server returns less records than requested.

Also see this related commit 3a974c6 (sorry for reformatting the file) which removed the bad behaviour.

Please sign in to comment.