diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -169,7 +169,7 @@ void prepare_distrenjob(struct frameset struct distrenjob *distrenjob; - distrenjob->type = 1; /*@TODO: add type to blendjob struct*/ + distrenjob->type = 1; distrenjob->name = name; distrenjob->submitter = submitter; distrenjob->email = email; @@ -233,14 +233,13 @@ void status_report_generator(struct dist unsigned short workers_working; /*< used to count the total number of workers working */ unsigned int numjobs; /*< used to track number of jobs */ - distrenjob_ptr = *distrenjobs_head; - workers_working = 0; + workers_working = 0; /*@TODO is there another way to trade how many workers are working, this is equal to assigned frames*/ numjobs = 0; - while(distrenjob_ptr) + for(distrenjob_ptr = *distrenjobs_head; distrenjob_ptr; distrenjob_ptr = distrenjob_ptr->next) { - if(distrenjob_ptr->priority != 0) - /* If the job is not done, scan it */ + if(distrenjob_ptr->frameset[0].status == 0 && distrenjob_ptr->frameset[1].status == 0) + /* If the job has been started, scan it */ { unsigned int framecounter; /*< to scan through frames */ unsigned long finished_frames; /*< variable that counts the completed frames */ @@ -287,7 +286,6 @@ void status_report_generator(struct dist if(finished_frames == distrenjob_ptr->total_frames) /* If all frames are complete */ { - distrenjob_ptr->priority = 0; /*< set priority to zero to indicate job is complete */ distrenjob_remove(distrenjobs_head, distrenjob_ptr); /*< remove this job from the linkedlist */ distrenjob_free(distrenjob_ptr); general_info.total_finished_jobs++; /*< add one to the total finished jobs */ @@ -306,11 +304,10 @@ void status_report_generator(struct dist general_info.rendering_clients = workers_working; /*< should this be a +=? */ - distrenjob_ptr = distrenjob_ptr->next; /*< This is the essence of linked lists and iterating through them */ numjobs ++; } /* while(distrenjob_ptr) */ - general_info.jobs_in_queue = (highest_jobnum - general_info.total_finished_jobs); /*< extraneous parentheses! */ + general_info.jobs_in_queue = numjobs; }