]> hackdaworld.org Git - physik/nlsop.git/commitdiff
dded destroy_it functionality (find associated jb, reset+queue it)
authorhackbard <hackbard>
Mon, 29 Nov 2004 15:31:52 +0000 (15:31 +0000)
committerhackbard <hackbard>
Mon, 29 Nov 2004 15:31:52 +0000 (15:31 +0000)
nlsop_server.c

index 44091085e10a967e07b5b99ad9bc12ede34b4b66..9adc6f83025fdf040bb7ff30cd83805ef7cbd934 100644 (file)
@@ -446,6 +446,8 @@ int parse_incoming(t_event *event,void *allineed) {
 
 void destroy_it(int signum) {
 
+  t_job *j;
+
   printf("connection to client (ch %d) fucked up!\n",gi);
   event_math(priv.net.connection[gi].fd,&(priv.event),READ,REMOVE);
   network_close(&(priv.net),gi);
@@ -453,6 +455,13 @@ void destroy_it(int signum) {
     list_del_current(&(priv.client));
     printf("removed client from list\n");
   }
+  if(list_search_data(&(priv.job),&gi,sizeof(int))==L_SUCCESS) {
+    printf("associated job found. resetting & queueing job.\n");
+    j=(t_job *)priv.job.current->data;
+    j->channel=-1;
+    j->status=IN_QUEUE;
+    j->progress=0;
+  }
   if(list_search_data(&(priv.gui),&gi,sizeof(int))==L_SUCCESS) {
     list_del_current(&(priv.gui));
     printf("removed gui from list\n");