|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 3233 (0xca1)
Types: TextFile
Names: »conn_finish.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/quipu/conn_finish.c«
/* conn_finish.c - deal with request to finish the association */
#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/conn_finish.c,v 7.0 89/11/23 22:16:45 mrose Rel $";
#endif
/*
* $Header: /f/osi/quipu/RCS/conn_finish.c,v 7.0 89/11/23 22:16:45 mrose Rel $
*
*
* $Log: conn_finish.c,v $
* Revision 7.0 89/11/23 22:16:45 mrose
* Release 6.0
*
*/
/*
* NOTICE
*
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
* this agreement.
*
*/
/* LINTLIBRARY */
#include "acsap.h"
#include "rosap.h"
#include "quipu/util.h"
#include "quipu/connection.h"
extern LLog * log_dsap;
void acs_log ();
/* ARGSUSED */
conn_finish(conn, acf)
Conn conn;
struct AcSAPfinish *acf;
{
struct oper_act * on;
int alive = FALSE;
extern time_t conn_timeout, time();
DLOG(log_dsap, LLOG_TRACE, ("conn_finish()"));
/* AcFinish received - see if anything is pending... */
for(on=conn->cn_operlist; on!=NULLOPER; on=on->on_next_conn)
if (on->on_state == ON_CHAINED) {
alive = TRUE;
break;
}
if (alive) {
/* See if oper has had time to complete */
/* if so remote DSA has probably lost the operation (never !!!) */
/* else reject the release */
if ( time((time_t*)0) - conn->cn_last_used < conn_timeout) {
if (!conn_rel_resp(conn,FALSE)) {
do_ds_unbind(conn);
conn_rel_abort (conn);
conn_extract(conn);
}
ACFFREE (acf);
return;
}
}
do_ds_unbind(conn);
if (!conn_rel_resp(conn,TRUE))
conn_rel_abort (conn);
conn_extract(conn);
ACFFREE (acf);
}
conn_rel_resp(conn,state)
struct connection * conn;
int state;
{
struct AcSAPindication aci_s;
struct AcSAPindication *aci = &(aci_s);
struct AcSAPabort *aca = &(aci->aci_abort);
DLOG(log_dsap, LLOG_TRACE, ("conn_rel_resp"));
if (state) {
DLOG(log_dsap, LLOG_NOTICE, ("A-RELEASE.RESPONSE: <%d, normal, accept, nullpe>",conn->cn_ad));
watch_dog ("AcRelResponse ACCEPT");
if(AcRelResponse(conn->cn_ad, ACS_ACCEPT,ACR_NORMAL,NULLPEP, 0, aci) != OK) {
watch_dog_reset();
acs_log(aca, "A-RELEASE.RESPONSE");
return FALSE;
}
watch_dog_reset();
} else {
LLOG(log_dsap, LLOG_EXCEPTIONS, ("A-RELEASE.RESPONSE: <%d, notfinished, reject, nullpe>",conn->cn_ad));
watch_dog ("AcRelResponse REJECT");
if(AcRelResponse(conn->cn_ad,ACS_REJECT, ACR_NOTFINISHED, NULLPEP, 0, aci) != OK) {
watch_dog_reset();
acs_log(aca, "A-RELEASE.RESPONSE");
return FALSE;
}
watch_dog_reset();
}
return TRUE;
}
conn_rel_abort (conn)
struct connection * conn;
{
struct AcSAPindication aci_s;
struct AcSAPindication *aci = &aci_s;
struct AcSAPabort *aca = &(aci->aci_abort);
if (conn->cn_initiator != INITIATED_BY_THIS)
return;
LLOG(log_dsap, LLOG_NOTICE, ("conn_rel_abort %d",conn->cn_ad));
watch_dog ("AcUAbortRequest (release)");
if(AcUAbortRequest(conn->cn_ad, NULLPEP, 0, aci) != OK)
{
watch_dog_reset();
acs_log(aca, "A-ABORT.REQUEST");
}
watch_dog_reset();
}