Changeset - 27c9b4850828
[Not reviewed]
default
0 4 0
ethanzonca - 16 years ago 2009-09-26 02:25:46

Fixed pseudo-code errors for tell_the_server
4 files changed with 5 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -504,13 +504,13 @@ int main(int argc, char *argv[])
 
	      sleep(10);
 
	    }
 
	  else
 
	    /* returnnum == 0 */
 
	    remotio_send_to_client(frame->num, job->jobnum); // Pseudo-sends data to client
 
	}
 

	
 
        int clientsays = 0; // @TODO: kill me
 
      /* If the client states that they finished the frame */
 
      	if(clientsays == DISTREN_REQUEST_DONEFRAME){
 
      	  clientstatus = CLIENTSTATUS_IDLE; // Sets the client back to idle
 
      	  finish_frame(&head, job, frame->num); // @TODO: Check that finish_frame really gets the jobnum somehow (Matt: can we give it the pointer to the job?, if not we can use distrenjob_get(&head, jobnum))
 
      	}
 

	
src/server/slave.c
Show inline comments
 
@@ -212,27 +212,26 @@ if(gotframe ==1)
 
    if(1==1){
 
     exec_blender(myjob, pathtoJobfile, pathtoOutput, framenum, threads); // @TODO: This warning should be fixed :D
 
    }
 

	
 
    // 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
 
      }
 
    busy = 2;
 
    // busy = 1; // @TODO: When done rendering, set this.
 
     }
 
    // When blender is finished, run this...
 
      if(busy==2){
 
        fprintf(stderr, "Finished frame %d in job %d, uploading...",framenum,jobnum);
 
        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.
 
      }
 

	
 
  return 0;
 
}
src/server/slavefuncs.c
Show inline comments
 
@@ -71,13 +71,13 @@ int delete_jobdata(int jobnum, char *dat
 
  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");
 
  return 0;
 
}
 

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

	
 
/** Function referenced by curlget() to write data to disk. */
 
size_t curl_writetodisk(void *ptr, size_t size, size_t nmemb, FILE *stream)
 
 {
 
    return fwrite(ptr, size, nmemb, stream);
src/server/slavefuncs.h
Show inline comments
 
@@ -23,13 +23,13 @@
 
#include "distrenjob.h"
 

	
 
#include <libxml/xpath.h>
 
#include <stdio.h>
 

	
 
xmlNodePtr xml_quickxpath(xmlXPathContextPtr xpathctxt, xmlChar *path);
 
void tell_the_server(char *stuff);
 
void tell_the_server(int stuff);
 
int delete_jobdata(int jobnum, char *datadir);
 
size_t curl_writetodisk(void *ptr, size_t size, size_t nmemb, FILE *stream);
 
int curlget(char *url, char *out);
 
int curlpost(char *filename, char *url);
 
int ssh_keygen();
 
int register_user(char *username, char *email);
0 comments (0 inline, 0 general)