Changeset - da918b8bbb36
[Not reviewed]
default
0 1 0
ethanzonca@localhost.localdomain - 16 years ago 2009-11-22 23:42:38
ethanzonca@localhost.localdomain
More minor edits
1 file changed with 11 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -102,12 +102,15 @@ int main(int argc, char *argv[])
 

	
 
  struct distrenjob *myjob; /* Structure to hold data gathered from the XML file */
 

	
 
  /* If the server says that every frame for jobnum is finished */
 
  if(1 == 0)
 
  /* If the server says that every frame for the last jobnum is finished,
 
   * OR if the data is getting old
 
   */
 
  if(1 == 0){
 
    delete_jobdata(jobnum, datadir);
 
  }
 
  
 
  /* If the slave is getting job info... */
 
  if(gotframe == 1)
 
  /* If we got a frame */
 
  if(gotframe != 0)
 
    {
 
      /* @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 */
 
@@ -128,18 +131,16 @@ int main(int argc, char *argv[])
 
      _distren_asprintf(&urltoOutput, "http://protofusion.org/distren/stor/tmp/", jobdatapath ); // Prepares the URL where output is posted
 
      _distren_asprintf(&pathtoXml, "%s/job%d/job%d.xml", datadir, jobnum ); // Prepares the path to the job's XML file
 

	
 
      // Downloads the job tar if it isn't  present. @TODO: Delete old job data
 
      // Downloads the job tar if it isn't  present.
 
      struct stat buffer;
 
      int fstatus = stat(pathtoJobfile, &buffer);
 

	
 
      /* If stat'ing the jobfile shows that the jobfile doesn't exist, we'll download it. */
 
      if(fstatus == -1)
 
	{
 
	  /* Downloads the Tar @TODO: add progress bar */
 
	  /* Downloads the Tar */
 
	  if( curlget(urltoTar, pathtoTar) == 0)
 
	    fprintf(stderr, "File downloaded without errors\n");
 
	    fprintf(stderr, "Job data retrieved successfully\n");
 
	  else
 
	    fprintf(stderr, "Download tar from server failed. Either the server is down, or the job hosting system is screwed up.\nContact admin@protofusion.org and include this message.\nGoodbye. Better luck next time.\n");
 
	    fprintf(stderr, "Downloading job data from server failed. Check your network connection.\n");
 
	}
 
      else
 
	fprintf(stderr, "Using cached job file...\n");
0 comments (0 inline, 0 general)