# HG changeset patch # User ethanzonca # Date 2009-08-03 22:19:11 # Node ID 9e92929b0e1d9d03852c96c1e3d291e9dc71d4ae # Parent 0ea6e0f201dc8f9377d17e1c9caf3ed702070d77 Fixed rendertubes :D diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -114,6 +114,7 @@ options_init(argc,argv,&my_cfg, myopts, /* These should all be filled by remotio and other code */ int jobnum; // Filled by the server telling the client what to render int framenum; // same as above +char *outputext = "JPG"; int gotframe; // set this to 1 after data for a job is received from the server int busy = 0; // Client business 1=busy 0=idle @@ -124,6 +125,7 @@ char *pathtoOutput; char *urltoTar; // Full URL to the server-side location of job#.tgz char *pathtoTar; // Full path to the location of the job#.tgz +char *urltoOutput; // Full URL where output is posted char *pathtoJobfile; // Full path to the job's main file @@ -133,34 +135,38 @@ char *pathtoJobfile; // Full path to the char *tarcmd; char *outdir; char *jobdatapath; - + fprintf(stderr, "Received %d in job %d, preparing to render...",framenum,jobnum); - + /** - Variable Preparation + Variable Preparation @todo find where to free() all of these */ _distren_asprintf(&jobdatapath, "job%d", jobnum); - _distren_asprintf(&urltoTar, "http://protofusion.org/distren/stor/job%d.tar.gz",jobnum); // Prepares URL to download from + _distren_asprintf(&urltoTar, "http://protofusion.org/distren/stor/job%d/job%d.tar.gz",jobnum); // Prepares URL to download from _distren_asprintf(&pathtoTar, "%s/stor/jobdata/job%d.tar.gz", datadir, jobnum); // Prepares destination to save to _distren_asprintf(&pathtoJobfile, "%s/%s/job.blend", datadir, jobdatapath ); // Prepares the path to the jobfile + _distren_asprintf(&urltoOutput, "http://protofusion.org/distren/stor/job%d/output/", jobdatapath ); // Prepares the URL where output is posted + _distren_asprintf(&pathtoOutput, "%s/job%d/output/frame%d.%s", datadir, jobnum, framenum, outputext ); // Prepares the path to the jobfile + + // = DATAPATH "/stor/jobdata/output.jpg"; /*< ? */ // Download the data - curlget(jobdataurl, pathtoTar); // Downloads the Tar @TODO: add a progressbar + curlget(urltoTar, pathtoTar); // Downloads the Tar @TODO: add a progressbar _distren_asprintf(&outdir, "/tmp/distren/job%d", jobnum); /*< @todo free() */ mkdir("/tmp/distren"); mkdir(outdir); - _distren_asprintf(&tarcmd, "tar -xvf \"%s\" -C \"%s\"", jobdatatar, outdir); + _distren_asprintf(&tarcmd, "tar -xvf \"%s\" -C \"%s\"", pathtoTar, outdir); system(tarcmd); free(tarcmd); - - 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. + + // exec_blender(blendjob, pathtoJobfile, pathtoOutput, 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){ @@ -177,7 +183,7 @@ char *pathtoJobfile; // Full path to the fprintf(stderr, "Finished frame %d in job %d, uploading...",framenum,jobnum); char *outputurl; _distren_asprintf(&outputurl, "http://protofusion.org/distren/stor/job%d/",jobnum); // Throws the jobnum nicely in the string - curlpost(outputpath, outputurl); // posts the output at outputpath to the server at outputurl + curlpost(pathtoOutput, urltoOutput); // posts the output at outputpath to the server at outputurl tell_the_server(DISTREN_REQUEST_DONEFRAME); // AKA "I'm done rendering that frame you sent me" busy=0; // Slave now becomes idle, doesn't need to tell the server anything, ssh handles this.