diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -484,6 +484,33 @@ int distrend_config_free(struct distrend } /* ************************** XML Functions ************************* */ +// writes the general_info.xml file which is a copy of the general_info structure +// except that it doesn't hold free_clients and rendering_clients +void updateGeneralInfo() +{ + xmlTextWriterPtr writer; + char *tmp; + + writer = xmlNewTextWriterFilename("general_info.xml", 0); + xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); + + xmlTextWriterStartElement(writer, (xmlChar*)"general_info"); + + _distren_asprintf(&tmp, "%d", general_info.jobs_in_queue); + xmlTextWriterWriteElement(writer, (xmlChar*)"jobs_in_queue", (xmlChar*)tmp); + _distren_asprintf(&tmp, "%d", general_info.total_finished_jobs); + xmlTextWriterWriteElement(writer, (xmlChar*)"total_finished_jobs", (xmlChar*)tmp); + _distren_asprintf(&tmp, "%d", general_info.total_frames_rendered); + xmlTextWriterWriteElement(writer, (xmlChar*)"total_frames_rendered", (xmlChar*)tmp); + _distren_asprintf(&tmp, "%d", general_info.highest_jobnum); + xmlTextWriterWriteElement(writer, (xmlChar*)"highest_jobnum", (xmlChar*)tmp); + general_info.free_clients = 0; + general_info.rendering_clients = 0; + + xmlTextWriterEndDocument(writer); + xmlFreeTextWriter(writer); +} + // returns 1 on successful completion of xml file // creates the xml file that slaves read from, and is used to restart distren int makeJobDataXML(struct distrenjob *job) @@ -495,7 +522,7 @@ int makeJobDataXML(struct distrenjob *jo // create xml document at the location tmp with no compression writer = xmlNewTextWriterFilename(tmp, 0); - xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL); + xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); // write resolution element and add its attributes xmlTextWriterStartElement(writer, (xmlChar*)"distrenjob");