From f9579e76a73b3645f1ab524f04aaca4dff11f039 Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 29 Nov 2004 15:31:52 +0000 Subject: [PATCH] dded destroy_it functionality (find associated jb, reset+queue it) --- nlsop_server.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); -- 2.39.2