example/thread-pool/psi.c
static int
transform_add(INKHttpTxn txnp)
{
  INKCont contp;
  ContData *data;
  INKReturnCode retval;

  contp = INKTransformCreate(transform_handler, txnp);
  if (contp == INK_ERROR_PTR) {
    INKError("[transform_add] Error while creating a new transformation");
    return 0;
  }

  data = cont_data_alloc();
  INKContDataSet(contp, data);

  retval = INKHttpTxnHookAdd(txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, contp);
  if (retval == INK_ERROR) {
    INKError("[transform_add] Error registering to transform hook");
    return 0;
  }
  return 1;
}
/*-------------------------------------------------------------------------
  transform_add
  Create a transformation and alloc data structure

  Input:
    txnp      current transaction
  Output :
  Return Value:
    1  if transformation created
    0  if not
  -------------------------------------------------------------------------*/
transform_add
Create a transformation and alloc data structure

txnp      current transaction
Output :
Return Value:
1  if transformation created
0  if not
transform_add Create a transformation and alloc data structure txnp current transaction Output : Return Value : 1 if transformation created 0 if not
static int
transform_add(INKHttpTxn txnp)
{
  INKCont contp;
  ContData *data;
  INKReturnCode retval;
  contp = INKTransformCreate(transform_handler, txnp);
  if (contp == INK_ERROR_PTR) {
    INKError("[transform_add] Error while creating a new transformation");
    return 0;
  }
  data = cont_data_alloc();
  INKContDataSet(contp, data);
  retval = INKHttpTxnHookAdd(txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, contp);
  if (retval == INK_ERROR) {
    INKError("[transform_add] Error registering to transform hook");
    return 0;
  }
  return 1;
}
static int transform_add ( INKHttpTxn txnp ) { INKCont contp ; ContData * data ; INKReturnCode retval ; contp = INKTransformCreate ( transform_handler , txnp ) ; if ( contp == INK_ERROR_PTR ) { INKError ( " " ) ; return 0 ; } data = cont_data_alloc ( ) ; INKContDataSet ( contp , data ) ; retval = INKHttpTxnHookAdd ( txnp , INK_HTTP_RESPONSE_TRANSFORM_HOOK , contp ) ; if ( retval == INK_ERROR ) { INKError ( " " ) ; return 0 ; } return 1 ; }
transform_add
Create a transformation and alloc data structure
transform_add Create a transformation and alloc data structure