File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / quipu / task_error.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* task_error.c - */

#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/quipu/task_error.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/quipu/task_error.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: task_error.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.0  89/11/23  22:18:12  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 "rosap.h"
#include "quipu/util.h"
#include "quipu/connection.h"

extern  LLog    * log_dsap;

void ros_log ();

/*
* The DSA has produced an error for the task, encode the error,
* generate a D-ERROR.REQUEST and update the task block.
*/
task_error(task)
register        struct task_act * task;
{
    int				  result;
    struct DSAPindication	  di_s;
    struct DSAPindication	* di = &(di_s);
    struct DSError              * err;
    struct connection		* cn = task->tk_conn;

#ifndef NO_STATS
    extern LLog * log_stat;
    LLOG (log_stat, LLOG_TRACE,("Error sent (%d)",task->tk_conn->cn_ad));
#endif

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

    if(task == NULLTASK)
    {
	LLOG(log_dsap, LLOG_FATAL, ("Task memerr 2"));
	return;
    }

    err = task->tk_error;

    /* Return the right sort of referral error */
    if(cn->cn_ctx == DS_CTX_X500_DAP)
    {
	if(err->dse_type == DSE_DSAREFERRAL)
	{
	    DLOG(log_dsap, LLOG_DEBUG, ("Changing DSAREFERRAL to REFERRAL (DAP)"));
	    err->dse_type = DSE_REFERRAL;
	}
    }
    else
    {
	if(err->dse_type == DSE_REFERRAL)
	{
	    DLOG(log_dsap, LLOG_DEBUG, ("Changing DSAREFERRAL to REFERRAL"));
	    err->dse_type = DSE_DSAREFERRAL;
	}
    }

    switch (cn->cn_ctx)
    {
	case DS_CTX_X500_DAP:
            watch_dog("DapErrorRequest");
	    result = DapErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
            watch_dog_reset();
	    break;
	case DS_CTX_X500_DSP:
            watch_dog("DspErrorRequest");
	    result = DspErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
            watch_dog_reset();
	    break;
	case DS_CTX_QUIPU_DSP:
            watch_dog("QspErrorRequest");
	    result = QspErrorRequest (cn->cn_ad, task->tk_dx.dx_id, err, di);
            watch_dog_reset();
	    break;
	default:
	    LLOG (log_dsap, LLOG_EXCEPTIONS, ("task_error(): Unknown context %d", cn->cn_ctx));
	    break;
    }

    if (result != OK)
    {
	if(di->di_type == DI_ABORT)
	{
	    LLOG(log_dsap, LLOG_FATAL, ("D-RESULT.REQUEST: fatal reject - fail the connection"));
	    cn->cn_state = CN_FAILED;
	}
    }

    if(cn->cn_state == CN_FAILED)
    {
	DLOG(log_dsap, LLOG_DEBUG, ("task_error(): extracting conn:"));
	conn_log(cn);
	conn_extract(cn);
    }
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.