+ new_output_find->sec=sec;
+ new_output_find->kb=kb;
+ new_output_find->bytes=bytes;
+ new_output_find->orig_kb=orig_kb;
+ new_output_find->next=NULL;
+ if (curlog == L_SUCCESS) {
+ new_output_find->status = "OK";
+ new_output_find->dump_status = "OK";
+ new_output_find->next = *output_find;
+ new_output_find->partnum = 1; /* L_SUCCESS is pre-splitting */
+ *output_find = new_output_find;
+ found_something = TRUE;
+ } else if (curlog == L_CHUNKSUCCESS || curlog == L_DONE ||
+ curlog == L_PARTIAL || curlog == L_FAIL) {
+ /* result line */
+ if (curlog == L_PARTIAL || curlog == L_FAIL) {
+ /* set dump_status of each part */
+ for (a_part_find = part_find;
+ a_part_find;
+ a_part_find = a_part_find->next) {
+ if (curlog == L_PARTIAL)
+ a_part_find->dump_status = "PARTIAL";
+ else {
+ a_part_find->dump_status = "FAIL";
+ a_part_find->message = g_string_chunk_insert_const(string_chunk, rest);
+ }
+ }
+ } else {
+ if (maxparts > -1) { /* format with part */
+ /* must check if all part are there */
+ int num_part = maxparts;
+ for (a_part_find = part_find;
+ a_part_find;
+ a_part_find = a_part_find->next) {
+ if (a_part_find->partnum == num_part &&
+ strcmp(a_part_find->status, "OK") == 0)
+ num_part--;
+ }
+ /* set dump_status of each part */
+ for (a_part_find = part_find;
+ a_part_find;
+ a_part_find = a_part_find->next) {
+ if (num_part == 0) {
+ a_part_find->dump_status = "OK";
+ } else {
+ a_part_find->dump_status = "FAIL";
+ a_part_find->message =
+ g_string_chunk_insert_const(string_chunk, "Missing part");
+ }
+ }
+ }
+ }
+ if (curlog == L_DONE) {
+ for (a_part_find = part_find;
+ a_part_find;
+ a_part_find = a_part_find->next) {
+ if (a_part_find->totalparts == -1) {
+ a_part_find->totalparts = maxparts;
+ }
+ if (a_part_find->orig_kb == 0) {
+ a_part_find->orig_kb = orig_kb;
+ }
+ }
+ }
+ if (part_find) { /* find last element */
+ for (a_part_find = part_find;
+ a_part_find->next != NULL;
+ a_part_find=a_part_find->next) {
+ }
+ /* merge part_find to *output_find */
+ a_part_find->next = *output_find;
+ *output_find = part_find;
+ part_find = NULL;
+ maxparts = -1;
+ found_something = TRUE;
+ g_hash_table_remove(part_by_dle, key);
+ }
+ free_find_result(&new_output_find);
+ } else { /* part line */
+ if (curlog == L_PART || curlog == L_CHUNK) {
+ new_output_find->status = "OK";
+ new_output_find->dump_status = "OK";
+ } else { /* PARTPARTIAL */
+ new_output_find->status = "PARTIAL";
+ new_output_find->dump_status = "PARTIAL";
+ }
+ /* Add to part_find list */
+ if (part_find) {
+ new_output_find->next = part_find;
+ part_find = new_output_find;
+ } else {
+ new_output_find->next = NULL;
+ part_find = new_output_find;
+ }
+ g_hash_table_insert(part_by_dle, g_strdup(key),
+ part_find);
+ found_something = TRUE;
+ }
+ amfree(key);