diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-06-11 22:26:41 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-06-11 22:26:41 (GMT) |
commit | 5e66e28d550e47f7a99d943c2553b7b1da1b8a17 (patch) | |
tree | bbee6c57116dd2c5166df6d73b41478b5d42b942 /src/H5VLiod_client.c | |
parent | 94b92a884e73afebe46766c4d8b45a62c6b757fa (diff) | |
download | hdf5-5e66e28d550e47f7a99d943c2553b7b1da1b8a17.zip hdf5-5e66e28d550e47f7a99d943c2553b7b1da1b8a17.tar.gz hdf5-5e66e28d550e47f7a99d943c2553b7b1da1b8a17.tar.bz2 |
[svn-r23756] update data integrity checks
add new API routines for checksums
- TODO: create checksums for non contiguous data
Diffstat (limited to 'src/H5VLiod_client.c')
-rw-r--r-- | src/H5VLiod_client.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index ef0806e..022f5ab 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -358,15 +358,19 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->status = H5AO_FAILED; req->state = H5VL_IOD_COMPLETED; } - if(info->checksum && info->checksum != read_status->cs) { - //free(info->status); - //info->status = NULL; - //info->bulk_handle = (hg_bulk_t *)H5MM_xfree(info->bulk_handle); - //HDfree(req->obj_name); - //info = (H5VL_iod_io_info_t *)H5MM_xfree(info); - /* MSC not returning an error because we injected this failure */ - fprintf(stderr, "Errrrr! Data integrity failure (expecting %u got %u).\n", - info->checksum, read_status->cs); + else { + uint32_t internal_cs; + + /* calculate a checksum for the data recieved */ + internal_cs = H5_checksum_fletcher32(info->buf_ptr, info->buf_size); + + /* verify data integrity */ + if(internal_cs != read_status->cs) { + fprintf(stderr, "Errrrr! Data integrity failure (expecting %u got %u).\n", + read_status->cs, internal_cs); + req->status = H5AO_FAILED; + req->state = H5VL_IOD_COMPLETED; + } } } |