Hello list, I'm on a forward proxy setup working with a plugin. I need to
delete a Header that comes from the user browser so it doesn't make it to
internet.
For this I'm trying to use TSHttpHdrDestroy, but it's doing nothing.
I get the right pointer to the header, but I'ts not destroyed.
Any light on this?
This is my current code:

Thanks you!


void
remove_internalid_header(TSHttpTxn txnp, TSCont contp)
{
  TSMBuffer bufp;
  TSMLoc hdr_loc;
  TSMLoc field_loc;

  if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
    TSError("couldn't retrieve client request header\n");
    return;
  }

 field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, "Inid", 4);

 TSDebug("myfirstfilter", "Inid field_loc=%p\n", field_loc); //this shows
the right pointer

  if (!field_loc) {
    TSError("no InId field\n");
  }

  TSHttpHdrDestroy(bufp, hdr_loc);

  if ( TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) != TS_SUCCESS) {
    TSError("unable to destroy InId field\n");
  }

  return ;
}

Reply via email to