diff --git a/src/server/distrenjob.c b/src/server/distrenjob.c --- a/src/server/distrenjob.c +++ b/src/server/distrenjob.c @@ -1,6 +1,6 @@ /* Copyright 2009 Nathan Phillip Brink - + This file is a part of DistRen. DistRen is free software: you can redistribute it and/or modify @@ -58,18 +58,16 @@ int distrenjob_new(struct distrenjob **d dj->email = (char *)NULL; dj->jobnum = 0; /*< @todo there should be a central jobnum allocator and a way to save the maximum jobnumber allocated */ dj->priority = 0; - dj->percent_done = 0; dj->completed_frames = 0; dj->assigned_frames = 0; - dj->avg_render_time = 0; - dj->time_remaining = (unsigned int)-1; + dj->total_render_time = 0; dj->frameset = (struct frameset *)NULL; /*< @todo does frameset need to be initialized here? */ - + return 0; } /** - writes struct from xml + writes struct from xml */ int xml2distrenjob(struct distrenjob **distrenjob, char *pathtoxml) { @@ -86,12 +84,12 @@ int xml2distrenjob(struct distrenjob **d if(distrenjob_new(distrenjob)) return 1; dj = *distrenjob; - + xmldoc = xmlReadFile(pathtoxml, NULL, XML_PARSE_PEDANTIC); if(!xmldoc) { /** - @todo are we able to depend on libxml2's printed errors or + @todo are we able to depend on libxml2's printed errors or channel them into syslog output (eventually)? Currently, this error is repetitious of a libxml2 error printed on stderr for us. @@ -101,7 +99,7 @@ int xml2distrenjob(struct distrenjob **d distrenjob_free(distrenjob); return 2; } - + xmlxpathcontext = xmlXPathNewContext(xmldoc); xmlnode = xml_quickxpath(xmlxpathcontext, (xmlChar *)"/distren/job"); if(!xmlnode) @@ -109,7 +107,7 @@ int xml2distrenjob(struct distrenjob **d distrenjob_free(distrenjob); return 3; } - + /*< @todo should we use xmlChar everywhere too? */ dj->name = (char *)xmlGetProp(xmlnode, (xmlChar *)"name"); if(!dj->name) @@ -117,7 +115,7 @@ int xml2distrenjob(struct distrenjob **d distrenjob_free(distrenjob); return 4; } - + /*< @todo validation needs to be done on usernames. e.g., currently, they shouldn't contain the '"' char */ dj->submitter = (char *)xmlGetProp(xmlnode, (xmlChar *)"submitter"); if(!dj->submitter)