diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -115,23 +115,32 @@ int gotframe; // set this to 1 after dat int busy = 0; // Client business 1=busy 0=idle -char *jobdatapath = "/path/to/job.tgz"; -char *outputpath = "/path/to/output.jpg"; +char *outputpath = DATAPATH "/stor/jobdata/output.jpg"; + -char *pathtoblend; // oh, blender-specific horribleness -char *jobdataurl; +char *urltoTar; // Full URL to the server-side location of job#.tgz +char *pathtoTar; // Full path to the location of the job#.tgz + +char *pathtoJobfile; // Full path to the job's main file // If the slave is getting job info... if(gotframe ==1){ fprintf(stderr, "Received %d in job %d, preparing to render...",framenum,jobnum); - _distren_asprintf(&jobdataurl, "http://protofusion.org/distren/stor/job%d.tgz",jobnum); // Throws jobnum in jobdataurl + /* Variable Preparation */ + _distren_asprintf(&urltoTar, "http://protofusion.org/distren/stor/job%d.tgz",jobnum); // Prepares URL to download from + _distren_asprintf(&pathtoTar, DATAPATH "/stor/jobdata/job%d.tgz", jobnum); // Prepares destination to save to + + _distren_asprintf(&pathtoJobfile, DATAPATH "%s/job.blend", jobdatapath ); // Prepares the path to the jobfile + - curlget(jobdataurl, jobdatapath); // downloads job data from the url to the path stated, @TODO: add a progressbar - _distren_asprintf(&pathtoblend, "%s/job.blend", jobdatapath ); // @TODO: Fix jobdatapath so it knows where to get the file for real :D - exec('tar -xvf job%d.tgz /tmp/distren/job%d',jobnum,jobnum); // @TODO: How will we do this? - exec_blender(blendjob, pathtoblend, outputpath, framenum); // So this should grab data from the struct? I have no idea. @TODO: Ohnobinki, we should clear this up. + // Download the data + + curlget(jobdataurl, pathtoTar); // Downloads the Tar @TODO: add a progressbar + + exec("tar -xvf" jobdatatar, /tmp/distren/job%d',jobnum,jobnum); // @TODO: How will we do this? + exec_blender(blendjob, pathtoBlend, outputpath, framenum); // So this should grab data from the struct? I have no idea. @TODO: Ohnobinki, we should clear this up. // Consider placing the following in the exec_blender() function while(busy == 1){