Changeset 684
- Timestamp:
- 08/02/09 13:43:39
- Files:
-
- openpgpsdk/trunk/src/lib/accumulate.c (modified) (1 diff)
- openpgpsdk/trunk/src/lib/compress.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/src/lib/accumulate.c
r636 r684 98 98 if(!cur) 99 99 return OPS_RELEASE_MEMORY; 100 ops_add_packet_to_keydata(cur, &content->packet);100 ops_add_packet_to_keydata(cur, &content->packet); 101 101 return OPS_KEEP_MEMORY; 102 102 openpgpsdk/trunk/src/lib/compress.c
r621 r684 68 68 // \todo remove code duplication between this and bzip2_compressed_data_reader 69 69 static int zlib_compressed_data_reader(void *dest,size_t length, 70 ops_error_t **errors,71 ops_reader_info_t *rinfo,72 ops_parse_cb_info_t *cbinfo)70 ops_error_t **errors, 71 ops_reader_info_t *rinfo, 72 ops_parse_cb_info_t *cbinfo) 73 73 { 74 74 z_decompress_arg_t *arg=ops_reader_get_arg(rinfo); … … 85 85 { 86 86 if(arg->inflate_ret != Z_STREAM_END) 87 OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR,"Compressed data didn't end when region ended."); 87 OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR, 88 "Compressed data didn't end when region ended."); 88 89 /* 89 90 else … … 131 132 if(!arg->region->indeterminate 132 133 && arg->region->length_read != arg->region->length) 133 OPS_ERROR(cbinfo->errors,OPS_E_P_DECOMPRESSION_ERROR,"Compressed stream ended before packet end."); 134 OPS_ERROR(cbinfo->errors,OPS_E_P_DECOMPRESSION_ERROR, 135 "Compressed stream ended before packet end."); 134 136 } 135 137 else if(ret != Z_OK) … … 154 156 // \todo remove code duplication between this and zlib_compressed_data_reader 155 157 static int bzip2_compressed_data_reader(void *dest,size_t length, 156 ops_error_t **errors,157 ops_reader_info_t *rinfo,158 ops_parse_cb_info_t *cbinfo)158 ops_error_t **errors, 159 ops_reader_info_t *rinfo, 160 ops_parse_cb_info_t *cbinfo) 159 161 { 160 162 bz_decompress_arg_t *arg=ops_reader_get_arg(rinfo); … … 171 173 { 172 174 if(arg->inflate_ret != BZ_STREAM_END) 173 OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR,"Compressed data didn't end when region ended."); 175 OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR, 176 "Compressed data didn't end when region ended."); 174 177 } 175 178 … … 198 201 n=sizeof arg->in; 199 202 200 if(!ops_stacked_limited_read((unsigned char *)arg->in,n,arg->region, 201 errors,rinfo,cbinfo)) 203 if(!ops_stacked_limited_read((unsigned char *)arg->in, n, 204 arg->region, errors, rinfo, 205 cbinfo)) 202 206 return -1; 203 207 … … 212 216 if(!arg->region->indeterminate 213 217 && arg->region->length_read != arg->region->length) 214 OPS_ERROR(cbinfo->errors,OPS_E_P_DECOMPRESSION_ERROR,"Compressed stream ended before packet end."); 218 OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR, 219 "Compressed stream ended before packet end."); 215 220 } 216 221 else if(ret != BZ_OK) 217 222 { 218 OPS_ERROR_1(cbinfo->errors,OPS_E_P_DECOMPRESSION_ERROR,"Invalid return %d from BZ2_bzDecompress", ret); 223 OPS_ERROR_1(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR, 224 "Invalid return %d from BZ2_bzDecompress", ret); 219 225 } 220 226 arg->inflate_ret=ret; … … 281 287 282 288 default: 283 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, "Compression algorithm %d is not yet supported", type); 289 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, 290 "Compression algorithm %d is not yet supported", type); 284 291 return 0; 285 292 } … … 304 311 305 312 default: 306 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, "Compression algorithm %d is not yet supported", type); 313 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, 314 "Compression algorithm %d is not yet supported", type); 307 315 return 0; 308 316 } … … 314 322 if(ret != Z_OK) 315 323 { 316 OPS_ERROR_1(&parse_info->errors, OPS_E_P_DECOMPRESSION_ERROR, "Cannot initialise ZIP or ZLIB stream for decompression: error=%d", ret); 324 OPS_ERROR_1(&parse_info->errors, OPS_E_P_DECOMPRESSION_ERROR, 325 "Cannot initialise ZIP or ZLIB stream " 326 "for decompression: error=%d", ret); 317 327 return 0; 318 328 } … … 323 333 if (ret != BZ_OK) 324 334 { 325 OPS_ERROR_1(&parse_info->errors, OPS_E_P_DECOMPRESSION_ERROR, "Cannot initialise BZIP2 stream for decompression: error=%d", ret); 335 OPS_ERROR_1(&parse_info->errors, OPS_E_P_DECOMPRESSION_ERROR, 336 "Cannot initialise BZIP2 stream " 337 "for decompression: error=%d", ret); 326 338 return 0; 327 339 } … … 330 342 331 343 default: 332 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, "Compression algorithm %d is not yet supported", type); 344 OPS_ERROR_1(&parse_info->errors, OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG, 345 "Compression algorithm %d is not yet supported", type); 333 346 return 0; 334 347 }
