Revert accidental commit (ECC-1621) - switching to a branch

This commit is contained in:
Shahram Najm 2023-06-27 16:44:29 +01:00
parent ee6d4eaba4
commit 4c55ce239a
1 changed files with 8 additions and 10 deletions

View File

@ -1157,16 +1157,17 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
if (headerMode) {
const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0;
size_t endOfHeadersOffset = 0;
grib_handle *h11, *h22;
GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0);
if (size1 == size2 && !memcmp(msg1, msg2, size1))
return 0;
err = 0;
GRIB_CHECK_NOLINE(grib_get_offset(h1, "endOfHeadersMarker", &endOfHeadersOffset), 0);
h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1);
h22 = grib_handle_new_from_partial_message(h1->context, msg2, size2);
iter = grib_keys_iterator_new(h1, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL);
iter = grib_keys_iterator_new(h11, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL);
if (!iter) {
grib_context_log(context, GRIB_LOG_ERROR, "unable to create the GRIB keys iterator");
@ -1176,19 +1177,16 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
while (grib_keys_iterator_next(iter)) {
name = grib_keys_iterator_get_name(iter);
/*printf("----- comparing %s\n",name);*/
size_t keyOffset = 0;
GRIB_CHECK_NOLINE(grib_get_offset(h1, name, &keyOffset), 0);
if (blocklisted(name))
continue;
if (keyOffset < endOfHeadersOffset) {
if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) {
err++;
}
}
if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED))
err++;
}
grib_keys_iterator_delete(iter);
grib_handle_delete(h11);
grib_handle_delete(h22);
return err;
}