|
|
1.1 root 1: /* ds_abandon.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/RCS/ds_abandon.c,v 7.0 89/11/23 22:17:03 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/RCS/ds_abandon.c,v 7.0 89/11/23 22:17:03 mrose Rel $
9: *
10: *
11: * $Log: ds_abandon.c,v $
12: * Revision 7.0 89/11/23 22:17:03 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: #include "quipu/util.h"
29: #include "quipu/attrvalue.h"
30: #include "quipu/abandon.h"
31: #include "quipu/dsp.h"
32: #include "quipu/ds_error.h"
33: #include "quipu/connection.h"
34:
35: extern LLog * log_dsap;
36: /* ARGSUSED */
37:
38: do_ds_abandon (arg, error)
39: struct ds_abandon_arg *arg;
40: struct DSError *error;
41: {
42: DLOG (log_dsap,LLOG_TRACE,("ds_abandon"));
43:
44: error->dse_type = DSE_ABANDON_FAILED;
45: error->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_CANNOTABANDON;
46: error->ERR_ABANDON_FAIL.DSE_ab_invokeid = 0;
47: return (NOTOK);
48: }
49:
50: perform_abandon(tk)
51: struct task_act * tk;
52: {
53: struct task_act * tk_tmp;
54: struct task_act **tk_p;
55: int ab_id = tk->tk_dx.dx_arg.dca_dsarg.arg_ab.aba_invokeid;
56: struct DSError * err = &(tk->tk_resp.di_error.de_err);
57:
58: DLOG(log_dsap, LLOG_TRACE, ("perform_abandon"));
59:
60: tk_p = &(tk->tk_conn->cn_tasklist);
61: for(tk_tmp = (*tk_p); tk_tmp!=NULLTASK; tk_tmp=tk_tmp->tk_next)
62: {
63: if(tk_tmp->tk_dx.dx_id == ab_id)
64: break;
65:
66: tk_p = &(tk_tmp->tk_next);
67: }
68: if(tk_tmp == NULLTASK)
69: {
70: LLOG(log_dsap, LLOG_NOTICE, ("perform_abandon - cannot find task to abandon"));
71: err->dse_type = DSE_ABANDON_FAILED;
72: err->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_NOSUCHOPERATION;
73: err->ERR_ABANDON_FAIL.DSE_ab_invokeid = ab_id;
74: return(NOTOK);
75: }
76: else
77: {
78: DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - found task to abandon"));
79:
80: /* Slice out task to abandon */
81: (*tk_p) = tk_tmp->tk_next;
82:
83: if(task_abandon(tk_tmp) != OK)
84: {
85: DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - task_abandon NOTOK"));
86: err->dse_type = DSE_ABANDON_FAILED;
87: err->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_CANNOTABANDON;
88: err->ERR_ABANDON_FAIL.DSE_ab_invokeid = ab_id;
89: return(NOTOK);
90: }
91: else
92: {
93: DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - task_abandon OK"));
94: tk->tk_result = &(tk->tk_resp.di_result.dr_res);
95: tk->tk_result->dcr_dsres.result_type = OP_ABANDON;
96: return(OK);
97: }
98: }
99: }
100:
101: task_abandon(tk)
102: struct task_act * tk;
103: {
104: struct oper_act * on;
105:
106: DLOG(log_dsap, LLOG_TRACE, ("task_abandon"));
107:
108: for(on = tk->tk_operlist; on != NULLOPER; on = on->on_next_task)
109: {
110: on->on_state = ON_ABANDONED;
111: on->on_task = NULLTASK;
112: }
113:
114: tk->tk_resp.di_error.de_err.dse_type = DSE_ABANDONED;
115: task_error(tk);
116:
117: return(OK);
118: }
119:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.