Changeset - 1ae1d5e6b902
[Not reviewed]
default
0 2 0
ethanzonca@localhost.localdomain - 16 years ago 2009-11-24 00:18:59
ethanzonca@localhost.localdomain
Cleanup, edits
2 files changed with 8 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -194,7 +194,6 @@ int main(int argc, char *argv[])
 
        free(pathtoOutput);
 

	
 
        tell_the_server(DISTREN_REQUEST_DONEFRAME); /* Tells the server that it's done rendering, and upload is done */
 
        /* Slave now becomes idle, doesn't need to tell the server anything, ssh handles this. */
 
      }
 
    else
 
      fprintf(stderr,"Nothing to do. Idling...\n");
src/server/slavefuncs.c
Show inline comments
 
@@ -65,12 +65,12 @@ int delete_jobdata(int jobnum, char *dat
 
{
 
  char *jobpath;
 
  _distren_asprintf(&jobpath, "%s/%d", datadir, jobnum);
 
  rmdir(jobpath);
 
  fprintf(stderr, "I just failed to remove all of your job data because I can only delete empty directories! Haha!\nPlease contact the dev team :D\n\tWe'd be overjoyed to know that someone was willing to try to use this in this devel/design/planning stage ;-)\n");
 
  // rmdir(jobpath);
 
  fprintf(stderr, "Please manually remove %s. Automatic removal is currently not implemented.\n", jobpath);
 
  return 0;
 
}
 

	
 
/** Stub stub stubbiness ugh @TODO: Kill me. */
 
/** Stub @TODO: Replace with remotio */
 
void tell_the_server(int stuff){
 
}
 

	
 
@@ -109,7 +109,7 @@ int curlget(char *url, char *out){
 
  curl_easy_cleanup(curl);
 
  }
 
  fprintf(stderr,"\n"); // Clears out he progressbar's carriage return
 
  return res; // 0 means OK, nonzero means AAAH badness
 
  return res; // 0 is OK, 1 is 404 or other error
 
}
 

	
 
/** Posts a file to a url with cUrl */
 
@@ -212,7 +212,6 @@ return 1; // Success
 

	
 
/* Executors */
 

	
 

	
 
/** Executor function for Blender operations */
 
void exec_blender(char *input, char *output, int frame)
 
{
 
@@ -220,9 +219,7 @@ void exec_blender(char *input, char *out
 
  int ret;
 
  char *frame_str;
 

	
 
  /* start execio code */
 
  char *command = "blender"; // @TODO: append .exe if win32?
 

	
 
  char *command = "blender"; // @TODO: append .exe if win32? Do we expect this to be in the PATH?
 
  char *cmd[] = { command, "-b", "-o", output, input, "-f", frame_str, (char *)NULL };
 

	
 
  char buf[10];
 
@@ -231,7 +228,7 @@ void exec_blender(char *input, char *out
 

	
 
  _distren_asprintf(&frame_str, "%i", frame);
 

	
 
  ret = execio_open(&testrem, command, cmd); // This path will be absolute for testing, @TODO: should be relative to install on production
 
  ret = execio_open(&testrem, command, cmd);
 
  buf[9] = '\0';
 
  while(!execio_read(testrem, buf, 9, &readlen))
 
    {
 
@@ -240,22 +237,15 @@ void exec_blender(char *input, char *out
 
       }
 
       buf[readlen] = '\0';
 
       fprintf(stderr, "read \"%s\"\n", buf);
 

	
 
       // @TODO: Better location for this code?
 
      tell_the_server(DISTREN_REQUEST_PROGRESS);
 
      fprintf(stderr, "Rendering...\n");
 
    }
 
  execio_close(testrem);
 
  /* end execio code */
 

	
 
  if(ret == 1){
 
    fprintf(stderr,"Error starting Blender. Check your install.\n");
 
    fprintf(stderr,"Error starting Blender. Check your path and installation.\n");
 
  }
 
  else{
 
    fprintf(stderr,"Execution was successful.\n");
 
    fprintf(stderr,"Execution of Blender was successful.\n");
 
  }
 
  // Consider placing the following in the exec_blender() function
 

	
 
}
 

	
 
void xmlinit()
0 comments (0 inline, 0 general)