some bugfixes + new tests
authorhackbard <hackbard>
Wed, 10 Nov 2004 12:46:48 +0000 (12:46 +0000)
committerhackbard <hackbard>
Wed, 10 Nov 2004 12:46:48 +0000 (12:46 +0000)
nlsop_server.c

index 747aa25..232f5cc 100644 (file)
@@ -129,26 +129,27 @@ int save_job(t_net *net,int channel,t_job *job,unsigned char dc) {
   printf("receiving data from client (%d)\n",job->size);
   data=DATA_OK;
 
   printf("receiving data from client (%d)\n",job->size);
   data=DATA_OK;
 
-  ret=network_receive_chan(net,channel,(unsigned char *)&d3l,
+  network_send_chan(net,channel,&data,sizeof(unsigned char));
+
+  network_receive_chan(net,channel,(unsigned char *)&d3l,
                            sizeof(d3_lattice));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got d3_lattice\n");
 
                            sizeof(d3_lattice));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got d3_lattice\n");
 
-  ret=network_receive_chan(net,channel,(unsigned char *)&info,sizeof(info));
+  network_receive_chan(net,channel,(unsigned char *)&info,sizeof(info));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got info\n");
 
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got info\n");
 
-  ret=network_receive_chan(net,channel,job->ac,job->size*sizeof(unsigned char));
+  network_receive_chan(net,channel,job->ac,job->size*sizeof(unsigned char));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got ac\n");
 
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got ac\n");
 
-  ret=network_receive_chan(net,channel,(unsigned char *)job->cc,
+  network_receive_chan(net,channel,(unsigned char *)job->cc,
                            job->size*sizeof(int));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got cc\n");
 
                            job->size*sizeof(int));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got cc\n");
 
-  ret=network_receive_chan(net,channel,(unsigned char *)&(job->step),
-                           sizeof(int));
+  network_receive_chan(net,channel,(unsigned char *)&(job->step),sizeof(int));
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got steps\n");
 
   network_send_chan(net,channel,&data,sizeof(unsigned char));
   printf("debug: got steps\n");
 
@@ -281,7 +282,10 @@ int handle_node(t_net *net,t_event *event,
         if(data==DC_END) {
           save_job(net,i,j,DC_END);
           /* reset client */
         if(data==DC_END) {
           save_job(net,i,j,DC_END);
           /* reset client */
+         printf("client in state %c now\n",c->status&IDLE?'i':'a');
           c->status=IDLE;
           c->status=IDLE;
+         printf("now: %c\n",c->status&IDLE?'i':'a');
+         printf("it is channel %d\n",c->channel);
           /* free job memory */
           free(j->ac);
           free(j->cc);
           /* free job memory */
           free(j->ac);
           free(j->cc);