Changeset - b173c86c5fcf
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-09-13 23:08:45

Fixed some pseudocode
1 file changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -117,7 +117,7 @@ options_init(argc,argv,&my_cfg, myopts, 
 
int jobnum;          // The job number that we're currently working
 
int framenum;        // @TODO: Remotio should fill this
 

	
 
int gotframe;        // set this to 1 after data for a job is received from the server
 
int gotframe = 0;        // set this to 1 after data for a job is received from the server
 
int busy = 0;        // Client business 1=busy 0=idle
 

	
 
char *urltoTar;      // Full URL to the server-side location of job#.tgz
 
@@ -145,7 +145,9 @@ if(gotframe ==1)
 
  {
 
    /* @TODO: Add remotio hooks */
 
    // jobnum = remoteio_read(jobnum); // Set jobnum from remoteio (we could use info from struct, but we need this info to download the xmlfile)
 
    jobnum = 0;
 
    //framenum = remoteio_read(jobnum); // Set framenum from remoteio
 
    framenum = 0;
 

	
 
    char *tarcmd;
 
    char *outdir;
 
@@ -213,7 +215,7 @@ if(gotframe ==1)
 

	
 
    // Consider placing the following in the exec_blender() function
 
    while(busy == 1){
 
      tell_the_server(DISTREN_REQUEST_PROGRESS);
 
      tell_the_server("DISTREN_REQUEST_PROGRESS");
 
        fprintf(stderr, "Rendering frame %d in job %d...",framenum,jobnum);
 
        sleep(5); // or not... this should be more event-driven, but should still give a heartbeat to the server
 
      }
 
@@ -226,7 +228,8 @@ if(gotframe ==1)
 
        char *outputurl;
 
        _distren_asprintf(&outputurl, "http://protofusion.org/distren/stor/job%d/",jobnum); // Aggregates the output url
 
        curlpost(pathtoOutput, urltoOutput); // uploads (HTML POST) the output at outputpath to the server at outputurl
 
        tell_the_server(DISTREN_REQUEST_DONEFRAME); // Tells the server that it's finished rendering this frame
 
        tell_the_server("DISTREN_REQUEST_DONEFRAME"
 
            ); // Tells the server that it's finished rendering this frame
 
        busy=0;
 
        // Slave now becomes idle, doesn't need to tell the server anything, ssh handles this.
 
      }
0 comments (0 inline, 0 general)