From: hackbard Date: Mon, 29 Nov 2004 15:31:52 +0000 (+0000) Subject: dded destroy_it functionality (find associated jb, reset+queue it) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9579e76a73b3645f1ab524f04aaca4dff11f039;p=physik%2Fnlsop.git dded destroy_it functionality (find associated jb, reset+queue it) --- diff --git a/nlsop_server.c b/nlsop_server.c index 4409108..9adc6f8 100644 --- a/nlsop_server.c +++ b/nlsop_server.c @@ -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");