|
|
1.1 ! root 1: /* conn_finish.c - deal with request to finish the association */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/quipu/RCS/conn_finish.c,v 7.1 90/03/15 11:18:41 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/quipu/RCS/conn_finish.c,v 7.1 90/03/15 11:18:41 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: conn_finish.c,v $ ! 12: * Revision 7.1 90/03/15 11:18:41 mrose ! 13: * quipu-sync ! 14: * ! 15: * Revision 7.0 89/11/23 22:16:45 mrose ! 16: * Release 6.0 ! 17: * ! 18: */ ! 19: ! 20: /* ! 21: * NOTICE ! 22: * ! 23: * Acquisition, use, and distribution of this module and related ! 24: * materials are subject to the restrictions of a license agreement. ! 25: * Consult the Preface in the User's Manual for the full terms of ! 26: * this agreement. ! 27: * ! 28: */ ! 29: ! 30: ! 31: /* LINTLIBRARY */ ! 32: ! 33: #include "quipu/dsap.h" ! 34: #include "quipu/util.h" ! 35: #include "quipu/connection.h" ! 36: ! 37: extern LLog * log_dsap; ! 38: ! 39: void ds_log(); ! 40: void acs_log (); ! 41: ! 42: /* ARGSUSED */ ! 43: conn_finish(conn, df) ! 44: struct connection * conn; ! 45: struct DSAPfinish * df; ! 46: { ! 47: int result; ! 48: struct oper_act * on; ! 49: extern time_t conn_timeout, timenow; ! 50: struct DSAPindication di_s; ! 51: struct DSAPindication * di = &(di_s); ! 52: ! 53: DLOG(log_dsap, LLOG_TRACE, ("conn_finish()")); ! 54: ! 55: /* Can release be negotiated? */ ! 56: if (conn->cn_start.cs_ds.ds_start.acs_start.ps_srequirements & SR_NEGOTIATED) ! 57: { ! 58: /* Should release be rejected? */ ! 59: for(on=conn->cn_operlist; on!=NULLOPER; on=on->on_next_conn) ! 60: if (on->on_state == ON_CHAINED) ! 61: break; ! 62: ! 63: if (on != NULLOPER) ! 64: { ! 65: /* ! 66: * See if oper has had time to complete ! 67: * if so remote DSA has probably lost the operation (never !!!) ! 68: * else reject the release ! 69: */ ! 70: ! 71: if ( timenow - conn->cn_last_used < conn_timeout) ! 72: { ! 73: watch_dog ("DUnBindReject"); ! 74: result = DUnBindReject (conn->cn_ad, ACS_REJECT, ! 75: ACR_NOTFINISHED, di); ! 76: watch_dog_reset (); ! 77: ! 78: if (result != OK) ! 79: { ! 80: do_ds_unbind(conn); ! 81: watch_dog ("DUAbortRequest (release)"); ! 82: result = DUAbortRequest (conn->cn_ad, di); ! 83: watch_dog_reset(); ! 84: conn_extract(conn); ! 85: } ! 86: return; ! 87: } ! 88: } ! 89: } ! 90: ! 91: do_ds_unbind(conn); ! 92: watch_dog ("DUnBindAccept"); ! 93: result = DUnBindAccept (conn->cn_ad, di); ! 94: watch_dog_reset(); ! 95: if (result != OK) { ! 96: watch_dog ("DUAbortRequest (release)"); ! 97: result = DUAbortRequest (conn->cn_ad, di); ! 98: watch_dog_reset(); ! 99: } ! 100: conn_extract(conn); ! 101: ! 102: } ! 103: ! 104: conn_rel_abort (conn) ! 105: struct connection * conn; ! 106: { ! 107: int result; ! 108: struct DSAPindication di_s; ! 109: struct DSAPindication *di = &di_s; ! 110: struct DSAPabort *da = &(di->di_abort); ! 111: ! 112: if (!conn->cn_initiator) ! 113: return; ! 114: ! 115: LLOG(log_dsap, LLOG_NOTICE, ("conn_rel_abort %d",conn->cn_ad)); ! 116: ! 117: watch_dog ("DUAbortRequest (release)"); ! 118: result = DUAbortRequest (conn->cn_ad, di); ! 119: watch_dog_reset(); ! 120: ! 121: if (result != OK) ! 122: { ! 123: ds_log (da, "DUAbortRequest in conn_rel_abort()"); ! 124: } ! 125: } ! 126:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.