171 int |
171 int |
172 BPQBlock::initialise(BlockInfo* b) |
172 BPQBlock::initialise(BlockInfo* b) |
173 { |
173 { |
174 ASSERT ( b != NULL); |
174 ASSERT ( b != NULL); |
175 |
175 |
|
176 BlockInfo* block = b; |
|
177 |
|
178 log_debug_p(LOG, "block: data_length() = %d", block->data_length()); |
|
179 log_debug_p(LOG, "block: data_offset() = %d", block->data_offset()); |
|
180 log_debug_p(LOG, "block: full_length() = %d", block->full_length()); |
|
181 log_debug_p(LOG, "block: complete() = %s", |
|
182 (block->complete()) ? "true" : "false" ); |
|
183 |
|
184 log_debug_p(LOG, "block: reloaded() = %s", |
|
185 (block->reloaded()) ? "true" : "false" ); |
|
186 |
|
187 |
|
188 if ( b->source() != NULL ) { |
|
189 BlockInfo* block_src = const_cast<BlockInfo*>(b->source());; |
|
190 |
|
191 log_debug_p(LOG, "block_src: data_length() = %d", block_src->data_length()); |
|
192 log_debug_p(LOG, "block_src: data_offset() = %d", block_src->data_offset()); |
|
193 log_debug_p(LOG, "block_src: full_length() = %d", block_src->full_length()); |
|
194 log_debug_p(LOG, "block_src: complete() = %s", |
|
195 (block_src->complete()) ? "true" : "false" ); |
|
196 |
|
197 log_debug_p(LOG, "block_src: reloaded() = %s", |
|
198 (block_src->reloaded()) ? "true" : "false" ); |
|
199 } |
|
200 |
|
201 /* |
|
202 |
|
203 |
|
204 |
176 BlockInfo* block = NULL; |
205 BlockInfo* block = NULL; |
177 |
206 |
178 if ( b->source() != NULL ) { |
207 if ( b->source() != NULL ) { |
179 block = const_cast<BlockInfo*>(b->source()); |
208 block = const_cast<BlockInfo*>(b->source()); |
180 log_debug_p(LOG, "BPQBlock::initialise: b->source() != NULL"); |
209 log_debug_p(LOG, "BPQBlock::initialise: b->source() != NULL"); |
181 } else { |
210 } else { |
182 log_debug_p(LOG, "BPQBlock::initialise: b->source() == NULL"); |
211 log_debug_p(LOG, "BPQBlock::initialise: b->source() == NULL"); |
183 block = b; |
212 block = b; |
184 } |
213 } |
185 |
214 */ |
186 int decoding_len=0; |
215 int decoding_len=0; |
187 u_int i=0, j=0, offset=0, len=0, flen=0, num_frags=0; |
216 u_int i=0, j=0, offset=0, len=0, flen=0, num_frags=0; |
188 u_char* buf = 0; |
217 u_char* buf = 0; |
189 |
218 /* |
190 ///////////////////////////////////////////////////// |
219 ///////////////////////////////////////////////////// |
191 ASSERT ( block != NULL ); |
220 ASSERT ( block != NULL ); |
192 // ASSERT ( block->data() != NULL ); |
221 // ASSERT ( block->data() != NULL ); |
193 |
222 |
194 log_debug_p(LOG, "BPQBlock::initialise: block != NULL"); |
223 log_debug_p(LOG, "BPQBlock::initialise: block != NULL"); |
200 log_debug_p(LOG, "BPQBlock::initialise: complete() = %s", |
229 log_debug_p(LOG, "BPQBlock::initialise: complete() = %s", |
201 (block->complete()) ? "true" : "false" ); |
230 (block->complete()) ? "true" : "false" ); |
202 log_debug_p(LOG, "BPQBlock::initialise: reloaded() = %s", |
231 log_debug_p(LOG, "BPQBlock::initialise: reloaded() = %s", |
203 (block->reloaded()) ? "true" : "false" ); |
232 (block->reloaded()) ? "true" : "false" ); |
204 //////////////////////////////////////////////////// |
233 //////////////////////////////////////////////////// |
205 |
234 */ |
206 log_debug_p(LOG, "BPQBlock::initialise: extracting offset"); |
235 log_debug_p(LOG, "BPQBlock::initialise: extracting offset"); |
207 offset = block->data_offset(); |
236 offset = block->data_offset(); |
208 log_debug_p(LOG, "BPQBlock::initialise: extracting full len"); |
237 log_debug_p(LOG, "BPQBlock::initialise: extracting full len"); |
209 flen = block->full_length(); |
238 flen = block->full_length(); |
210 log_debug_p(LOG, "BPQBlock::initialise: extracting len"); |
239 log_debug_p(LOG, "BPQBlock::initialise: extracting len"); |