[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

1537.0. "Toolkit: ILVTOOBIG from SET_CVR_AND_RPLY" by BIKINI::KRAUSE (Robert, TSSC-NaC @MUH) Fri Sep 20 1991 16:04

    [ DECmcc Developer's Toolkit V1.1, VMS V5.4-1 ]

    A Customer is in the process of developing an access module
    using the Developer's Toolkit.

    The toolkit routine MCC_DESFRAME_SET_CVR_AND_REPLY returns a
    condition value of MCC_S_ILVTOOBIG when trying to build an
    Out_P with about 200 Attributes (it works ok up to some 50
    attributes).

    The Management Module Programming manual says on page C-11:

        "Note: May want to alloc new 'temp_outp' (size=size 2)
        if you ever get ILVTOOBIG - and then re-execute this
        module (i = 1)"

    There is no such symbol 'temp_outp' accessible, so could
    someone please explain what is meant by this Note and what
    we should do to increase the temporary buffer used by the
    routine?

    Also any hint for a workaround will be appreciated to get
    the customer going again.

    Thanks in advance,

    *Robert


    P.S.: I consider this a documentation deficiency. Could the
          responsible writer please look into it?
T.RTitleUserPersonal
Name
DateLines
1537.1This is a bug 8(NANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Sep 20 1991 16:5815
The Design Framework builds your Reply in a temporary buffer, named 'temp_outp'

The size of the buffer is 2048 bytes - obviously not big enough for the
data you are returning.

This has been corrected in the v1.2 release.

There is a workaround - implement the code which was put into the v1.2
set-cvr-and-reply code within your management module.

There are a few areas in the management module which will need fixing
to properly handle the ILV-TOO-BIG error.  I will post them in the next reply

Keith Roberts
DECmcc Toolkit Team
1537.2Here's the workaround - let me know if there are any problemsNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Sep 20 1991 17:52207
RE: .0

> The Management Module Programming manual says on page C-11:
>
>  "Note: May want to alloc new 'temp_outp' (size=size 2)
>   if you ever get ILVTOOBIG - and then re-execute this
>   module (i = 1)"

    I have found the section in the Management Module Programming
    guide (page C-11) which you commented on, and it will be fixed
    for the v1.2 release.

> The toolkit routine MCC_DESFRAME_SET_CVR_AND_REPLY returns a
> condition value of MCC_S_ILVTOOBIG when trying to build an
> Out_P with about 200 Attributes (it works ok up to some 50
> attributes).

    The workaround for an MCC_S_ILVTOOBIG status from the
    "mcc_desframe_set_cvr_and_reply" routine requires changes to:

       o  the "end_directive" routine which calls the
          "mcc_desframe_set_cvr_and_reply" routine

       o  the "init_handle_more" routine

    Sorry for the inconvenience and thank you for pointing out the
    problem with the documentation.

    If you have any problems with this workaround, please let me know.

    Thanks,

    Keith Roberts
    DECmcc Toolkit Team



    >>> end_directive ---------------------------------------------------

        Add following the call to "mcc_desframe_set_cvr_and_reply":


/*
 *  ---------------- Process ILVTOOBIG error status ---------------------
 *
 *  If ILV has returned the MCC_S_ILVTOOBIG error status, then Out-P isn't
 *  big enough for the reply we're trying to construct.  In this case:
 *
 *    o  We'll ask for twice as much space (curlen = maxstrlen * 2)
 *    o  Set the the 'more_data' flag to TRUE (to save the call context)
 *    o  and return the MCC_S_INSUF_BUF status.
 *
 *  The caller should reallocate the Out-P buffer with the buffer byte
 *  count we specified in 'curlen' - then call us back.  The directive
 *  Init-handle-more code will detect the last-status of MCC_S_INSUF_BUF
 *  thereby calling mcc_desframe_set_cvr_and_reply again.
 *
 *  Hopefully this time the buffer will be big enough.
 */

  if (status == MCC_S_ILVTOOBIG) {
    p_callargs->p_out_p->mcc_w_curlen = p_callargs->p_out_p->mcc_w_maxstrlen * 2;
    (*p_context)->flags.more_data     = TRUE;
    status                            = MCC_S_INSUF_BUF;
  }



    >>> init_handle_more ------------------------------------------------

        Replace your "init_handle_more" routine with the following:

/************************************************************************
 *                                                                      *
 *  init_handle_more                          TEMPLATE FOR A DIRECTIVE  *
 *                                                                      *
 ************************************************************************
 *                                                                      *
 *  FUNCTIONAL DESCRIPTION:                                             *
 *                                                                      *
 *    This routine is called during module initialization:  MORE        *
 *                                                                      *
 *    This module has been previously (one or more times) called.  The  *
 *    Local Context Block address must be extracted from the Call       *
 *    Handle argument.  The address was put into the Handle when        *
 *    the MM returned the last time (with a state of 'more')            *
 *                                                                      *
 *    To comply with the DECmcc Call Interface and Design Framework,    *
 *    certain operations must be performed during this time:            *
 *                                                                      *
 *      o  Get the Local Context Block address                          *
 *      o  Re-initialize Local Context block fields                     *
 *          - Set the More-loop flag to TRUE                            *
 *          - Set the More-data flag to FALSE                           *
 *      o  If the 'last-status' wasn't INSUF_BUF                        *
 *          - Set the Reply-index to 0                                  *
 *                                                                      *
 *    Any steps needed by your MM can then be executed - Don't forget   *
 *    to test 'status' for Normal                                       *
 *                                                                      *
 *  FORMAL PARAMETERS:                                                  *
 *   Inputs                                                             *
 *     p_callargs, p_context                                            *
 *                                                                      *
 *   Outputs                                                            *
 *     p_callargs, p_context                                            *
 *                                                                      *
 *  IMPLICIT PARAMETERS:                                                *
 *   Inputs                                                             *
 *      none                                                            *
 *                                                                      *
 *   Outputs                                                            *
 *      none                                                            *
 *                                                                      *
 *  RETURN VALUES:                                                      *
 *                                                                      *
 *    MCC_S_NORMAL                Initialization completed sucessfully  *
 *    MCC_S_INV_HANDLE            Problem with the Call Handle          *
 *    any other MCC status value                                        *
 *                                                                      *
 ************************************************************************/


static MCC_T_CVR  init_handle_more (p_callargs, p_context)

dt_callargs        *p_callargs;
dt__LocalContext  **p_context;

{
MCC_T_CVR           status = MCC_S_NORMAL;

/*
 *  ----------------------- Generic processing --------------------------
 *
 *  Get the Local Context Block address from the Handle
 */

  status = mcc_ahs_get_context(
    p_callargs->p_handle,
    p_context );

  if ((status != MCC_S_NORMAL) || (*p_context == MCC_K_NULL_PTR))
    status = MCC_S_INV_HANDLE;

/*
 *  Re-initialize Local Context fields
 *    o  We are in a 'more loop'
 *    o  The call hasn't resulted in 'more data' (yet)
 */

  if (status == MCC_S_NORMAL) {
    (*p_context)->flags.more_loop = TRUE;
    (*p_context)->flags.more_data = FALSE;
  }

/*
 *  ------------------ Your initialization goes here --------------------
 *
 *  Place your own MM initialization code here.  Do not forget to test
 *  for a Normal 'status' before executing any code !!!
 *
 *    if (status == MCC_S_NORMAL) {
 *      :
 *      :
 *    } 
 */


/*
 *  ------------------- Process INSUF_BUF status ------------------------
 *
 *  Continue re-initializing the Local Context Block
 *    o  Set the Reply-index to undefined ...
 *
 *  ... If the 'last-status' (status returned from the previous
 *  call) was *not* INSUF_BUF - then the 'reply-index' can
 *  be set to undefined and a Normal status returned.
 *
 *  If the 'last-status' *was* INSUF_BUF, then we want to
 *  return that status, skipping the 'do-directive' code and going
 *  directly to 'end-directive'.
 *
 *  The INSUF_BUF status indicates that the previous call
 *  could not complete because the Callers Out-P buffer was too
 *  small - by now, they should have increased the buffer size,
 *  and we can proceed to building Out-P again.  Leaving the
 *  Reply-index value as it was set before enables us to remember
 *  which reply was being built.
 *
 *  If we have a BAD status,
 *    Set the reply_index to 0.  This will allow the bad status to
 *    be reported to the calling management module
 */

  if (status == MCC_S_NORMAL) {
    if ((*p_context)->last_status != MCC_S_INSUF_BUF)
      (*p_context)->reply_index   = 0;
    else
      status = MCC_S_INSUF_BUF;

  } else /* BAD(status) */
    (*p_context)->reply_index = 0;

  return( status );
}
	/*****  end  init_handle_more  *****/