DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T c

⟦3bd26d45a⟧ TextFile

    Length: 4598 (0x11f6)
    Types: TextFile
    Names: »conn_release.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/quipu/conn_release.c« 

TextFile

/* conn_release.c - normal association release */

#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/conn_release.c,v 7.0 89/11/23 22:16:48 mrose Rel $";
#endif

/*
 * $Header: /f/osi/quipu/RCS/conn_release.c,v 7.0 89/11/23 22:16:48 mrose Rel $
 *
 *
 * $Log:	conn_release.c,v $
 * Revision 7.0  89/11/23  22:16:48  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;
Conn    conn_alloc();
void    conn_free();
void    acs_log ();
extern time_t time();

conn_release(conn)
struct connection       * conn;
{
    struct AcSAPrelease     acr_s;
    struct AcSAPrelease     *acr = &(acr_s);
    struct AcSAPindication  aci_s;
    struct AcSAPindication  *aci = &(aci_s);
    struct AcSAPabort       *aca = &(aci->aci_abort);

    DLOG(log_dsap, LLOG_TRACE, ("conn_release"));


    DLOG(log_dsap, LLOG_NOTICE, ("RY-UNBIND: <%d, normal, nullpe>", conn->cn_ad));

    watch_dog ("RyUnBind");
    switch (RyUnBindAux (conn->cn_ad, ACF_NORMAL, NULLPE, acr, aci, OK)) {
    case NOTOK:
	watch_dog_reset();
    	do_ds_unbind(conn);
	DLOG(log_dsap, LLOG_TRACE, ("conn_release: acr_affirmative = %d", acr->acr_affirmative));
	acs_log(aca, "A-RELEASE.REQUEST");
	break;
   case OK:
	watch_dog_reset();
	DLOG(log_dsap, LLOG_TRACE, ("conn_release: acr_affirmative = %d", acr->acr_affirmative));
	if (!acr->acr_affirmative)
	{
	    if ((conn->cn_last_release == conn->cn_last_used) 
		&& (conn->cn_initiator == INITIATED_BY_THIS)) {
		    LLOG (log_dsap,LLOG_EXCEPTIONS,("conn_release rejected again without activity - Aborting %d",conn->cn_ad));
		    do_ds_unbind(conn);
		    conn_rel_abort (conn);
	    } else {
		    LLOG (log_dsap,LLOG_EXCEPTIONS,("conn_release rejected - continuing with association %d",conn->cn_ad));
		    conn->cn_last_release = conn->cn_last_used = time((time_t *) 0);
		    return NOTOK;
	    }
	}
	else
	{
	    do_ds_unbind(conn);
	    DLOG(log_dsap, LLOG_TRACE, ("conn_release: Conn finished!"));
	}
	break;
    case DONE:
	watch_dog_reset();
	DLOG (log_dsap,LLOG_NOTICE, ("Waiting for release"));
	conn->cn_state = CN_CLOSING;
	conn->cn_last_release = conn->cn_last_used = time((time_t *) 0);
	return NOTOK;
    default:
	watch_dog_reset();
	LLOG (log_dsap, LLOG_EXCEPTIONS, ("Unexpected return from RyUnBindAux"));
	return NOTOK;
    }

    DLOG(log_dsap, LLOG_DEBUG, ("conn_release calling conn_extract"));
    conn_extract(conn);
    return OK;
}

conn_release_retry(conn)
struct connection       * conn;
{
    struct AcSAPrelease     acr_s;
    struct AcSAPrelease     *acr = &(acr_s);
    struct AcSAPindication  aci_s;
    struct AcSAPindication  *aci = &(aci_s);
    struct AcSAPabort       *aca = &(aci->aci_abort);

    DLOG(log_dsap, LLOG_NOTICE, ("conn_release retry (%d)",conn->cn_ad));

    watch_dog ("RyUnBindRetry");
    switch (RyUnBindRetry (conn->cn_ad, acr, aci)) {
    case NOTOK:
	watch_dog_reset();
    	do_ds_unbind(conn);
	DLOG(log_dsap, LLOG_TRACE, ("conn_release: acr_affirmative = %d", acr->acr_affirmative));
	acs_log(aca, "A-RELEASE.REQUEST");
	break;
   case OK:
	watch_dog_reset();
	DLOG(log_dsap, LLOG_TRACE, ("conn_release: acr_affirmative = %d", acr->acr_affirmative));
	if (!acr->acr_affirmative)
	{
	    if ((conn->cn_last_release == conn->cn_last_used) 
		&& (conn->cn_initiator == INITIATED_BY_THIS)) {
		    LLOG (log_dsap,LLOG_EXCEPTIONS,("conn_release rejected again without activity - Aborting %d",conn->cn_ad));
		    do_ds_unbind(conn);
		    conn_rel_abort (conn);
	    } else {
		    LLOG (log_dsap,LLOG_EXCEPTIONS,("conn_release rejected - continuing with association %d",conn->cn_ad));
		    conn->cn_last_release = conn->cn_last_used = time((time_t *) 0);
		    return NOTOK;
	    }
	}
	else
	{
	    do_ds_unbind(conn);
	    DLOG(log_dsap, LLOG_TRACE, ("conn_release: Conn finished!"));
	}
	break;
    case DONE:
	watch_dog_reset();
	DLOG (log_dsap,LLOG_TRACE, ("Still Waiting for release"));
	conn->cn_last_release = conn->cn_last_used = time((time_t *) 0);
	return NOTOK;
    default:
	watch_dog_reset();
	LLOG (log_dsap, LLOG_EXCEPTIONS, ("Unexpected return from RyUnBindAux"));
	return NOTOK;
    }

    DLOG(log_dsap, LLOG_DEBUG, ("conn_release calling conn_extract"));
    conn_extract(conn);
    return OK;
}