Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration

Diff for /libnutss/examples/slinks_variable_load.c between versions 1.15 and 1.16

version 1.15, 2007/06/30 22:37:20 version 1.16, 2007/07/02 16:18:27
Line 63  void *recvthread(void *arg) {  Line 63  void *recvthread(void *arg) { 
    }     }
    else if(ptr->next) {     else if(ptr->next) {
   assert(flows == ptr);    assert(flows == ptr);
     ptr->next->last = NULL;
   flows = ptr->next;    flows = ptr->next;
    }     }
   
    if(flows) flows->last = NULL;  
    else if(ptr->last) {     else if(ptr->last) {
   assert(flows != ptr);    assert(flows != ptr);
   ptr->last->next = NULL;    ptr->last->next = NULL;
Line 80  void *recvthread(void *arg) {  Line 79  void *recvthread(void *arg) { 
    expiration = 1;     expiration = 1;
     }      }
     ptr = ptr->next;      ptr = ptr->next;
   if(expiration)free(axe);    if(expiration){ free(axe);axe = NULL; }
      }       }
      sprintf(buf,"%s||\n",buf);       sprintf(buf,"%s||\n",buf);
   
Line 110  void *recvthread(void *arg) {  Line 109  void *recvthread(void *arg) { 
     if(f && f != stderr) { fclose(f); f = NULL; }      if(f && f != stderr) { fclose(f); f = NULL; }
     if(s && s != stdout) { fclose(s); s = NULL; }      if(s && s != stdout) { fclose(s); s = NULL; }
   
       for(ptr = flows;ptr;) {axe = ptr; ptr = ptr->next; free(axe);}
   
     pthread_exit(NULL);      pthread_exit(NULL);
 }  }
   
Line 125  int main(int argc, char **argv) {  Line 126  int main(int argc, char **argv) { 
         limit = atoi(argv[3]);          limit = atoi(argv[3]);
         duration = atoi(argv[4]);          duration = atoi(argv[4]);
         weight = atoi(argv[5]);          weight = atoi(argv[5]);
      maxload = atoi(argv[6]);        maxload = atoi(argv[6]);
     }      }
     else {      else {
         printf("Usage:\n  slinks_variable_load node_number peers_number time_limit flow_duration flow_weight max_load\n");          printf("Usage:\n  slinks_variable_load node_number peers_number time_limit flow_duration flow_weight max_load\n");
Line 164  int main(int argc, char **argv) {  Line 165  int main(int argc, char **argv) { 
   
     snprintf(tmp, sizeof(tmp), "%d;%d;0;", duration, weight);      snprintf(tmp, sizeof(tmp), "%d;%d;0;", duration, weight);
   
   while (time++ <4*limit) { // (i-- != 0) {    while (time++ <3*limit) { // (i-- != 0) {
         swaplinks_sendtoany(swp, tmp, strlen(tmp)+1, 0);          swaplinks_sendtoany(swp, tmp, strlen(tmp)+1, 0);
         if(s) fprintf(s,"   %d sent request %d\n",num,time);          if(s) fprintf(s,"   %d sent request %d\n",num,time);
         sleep(2);          sleep(2);

Removed from v.1.15  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment