|
|
1.1 root 1: /* task_error.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/RCS/task_error.c,v 7.0 89/11/23 22:18:12 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/RCS/task_error.c,v 7.0 89/11/23 22:18:12 mrose Rel $
9: *
10: *
11: * $Log: task_error.c,v $
12: * Revision 7.0 89/11/23 22:18:12 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: /* LINTLIBRARY */
29:
30: #include "rosap.h"
31: #include "quipu/util.h"
32: #include "quipu/connection.h"
33:
34: extern LLog * log_dsap;
35:
36: void ros_log ();
37:
38: /*
39: * The DSA has produced an error for the task, encode the error,
40: * generate a D-ERROR.REQUEST and update the task block.
41: */
42: task_error(task)
43: register struct task_act * task;
44: {
45: int result;
46: struct DSAPindication di_s;
47: struct DSAPindication * di = &(di_s);
48: struct DSError * err;
49: struct connection * cn = task->tk_conn;
50:
51: #ifndef NO_STATS
52: extern LLog * log_stat;
53: LLOG (log_stat, LLOG_TRACE,("Error sent (%d)",task->tk_conn->cn_ad));
54: #endif
55:
56: DLOG(log_dsap, LLOG_TRACE, ("task_error"));
57:
58: if(task == NULLTASK)
59: {
60: LLOG(log_dsap, LLOG_FATAL, ("Task memerr 2"));
61: return;
62: }
63:
64: err = task->tk_error;
65:
66: /* Return the right sort of referral error */
67: if(cn->cn_ctx == DS_CTX_X500_DAP)
68: {
69: if(err->dse_type == DSE_DSAREFERRAL)
70: {
71: DLOG(log_dsap, LLOG_DEBUG, ("Changing DSAREFERRAL to REFERRAL (DAP)"));
72: err->dse_type = DSE_REFERRAL;
73: }
74: }
75: else
76: {
77: if(err->dse_type == DSE_REFERRAL)
78: {
79: DLOG(log_dsap, LLOG_DEBUG, ("Changing DSAREFERRAL to REFERRAL"));
80: err->dse_type = DSE_DSAREFERRAL;
81: }
82: }
83:
84: switch (cn->cn_ctx)
85: {
86: case DS_CTX_X500_DAP:
87: watch_dog("DapErrorRequest");
88: result = DapErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
89: watch_dog_reset();
90: break;
91: case DS_CTX_X500_DSP:
92: watch_dog("DspErrorRequest");
93: result = DspErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
94: watch_dog_reset();
95: break;
96: case DS_CTX_QUIPU_DSP:
97: watch_dog("QspErrorRequest");
98: result = QspErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
99: watch_dog_reset();
100: break;
101: default:
102: LLOG (log_dsap, LLOG_EXCEPTIONS, ("task_error(): Unknown context %d", cn->cn_ctx));
103: break;
104: }
105:
106: if (result != OK)
107: {
108: if(di->di_type == DI_ABORT)
109: {
110: LLOG(log_dsap, LLOG_FATAL, ("D-RESULT.REQUEST: fatal reject - fail the connection"));
111: cn->cn_state = CN_FAILED;
112: }
113: }
114:
115: if(cn->cn_state == CN_FAILED)
116: {
117: DLOG(log_dsap, LLOG_DEBUG, ("task_error(): extracting conn:"));
118: conn_log(cn);
119: conn_extract(cn);
120: }
121: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.