|
|
1.1 root 1: /* conn_dispatch.c - deal with an event on an open connection */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/RCS/conn_dispatch.c,v 7.0 89/11/23 22:16:44 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/RCS/conn_dispatch.c,v 7.0 89/11/23 22:16:44 mrose Rel $
9: *
10: *
11: * $Log: conn_dispatch.c,v $
12: * Revision 7.0 89/11/23 22:16:44 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/dsap.h"
29: #include "tsap.h"
30: #include "quipu/util.h"
31: #include "quipu/connection.h"
32:
33: extern LLog * log_dsap;
34:
35: /*
36: * Something has happened on the association with descriptor "ad".
37: * Check what type of activity it is and dispatch to an appropriate
38: * routine to handle the activity.
39: */
40: conn_dispatch(cn)
41: struct connection * cn;
42: {
43: int result;
44: struct DSAPindication di_s;
45: struct DSAPindication *di = &di_s;
46: struct DSAPabort *da = &(di->di_abort);
47: extern void ds_log();
48:
49: DLOG (log_dsap,LLOG_TRACE,( "conn_dispatch()"));
50:
51: watch_dog("DWaitRequest");
52: result = DWaitRequest(cn->cn_ctx, cn->cn_ad, OK, di);
53: watch_dog_reset();
54:
55: if (result == DONE)
56: {
57: /* TIMER expired */
58: return;
59: }
60:
61: if (result == NOTOK)
62: {
63: switch(di->di_type)
64: {
65: case DI_PREJECT:
66: DLOG(log_dsap, LLOG_DEBUG, ("conn_dispatch calling oper_preject"));
67: oper_preject(cn, &(di->di_preject));
68: return;
69:
70: case DI_ABORT:
71: ds_log(da, "DWaitRequest");
72: DLOG(log_dsap, LLOG_DEBUG, ("conn_dispatch calling conn_extract"));
73: do_ds_unbind (cn);
74: conn_extract(cn);
75: return;
76:
77: default:
78: LLOG (log_dsap,LLOG_EXCEPTIONS,( "Unknown indication type : %d", di->di_type));
79: return;
80: }
81: }
82:
83: switch(di->di_type)
84: {
85: case DI_INVOKE:
86: if (task_invoke(cn, &(di->di_invoke)) != OK)
87: {
88: LLOG (log_dsap,LLOG_EXCEPTIONS,("task_invoke failed in conn_dispatch"));
89: }
90: break;
91:
92: case DI_RESULT:
93: oper_result(cn, di);
94: break;
95:
96: case DI_ERROR:
97: oper_error(cn, di);
98: break;
99:
100: case DI_FINISH:
101: conn_finish(cn, &(di->di_finish));
102: break;
103:
104: default:
105: LLOG (log_dsap,LLOG_EXCEPTIONS,( "Unknown indication type : %d", di->di_type));
106: break;
107: }
108: }
109:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.