adaptation_meta

Asked by manoj on 2016-01-28

I have used adaptation_meta directive in squid for pass the SNI information . I need to access the this adaptation_meta information in ecap adpater. Currently i used ecap version 1.0. anyone can tell how to read these meta information in ecap.

Question information

Language:
English Edit question
Status:
Solved
For:
eCAP Edit question
Assignee:
No assignee Edit question
Solved by:
Alex Rousskov
Solved:
2016-01-29
Last query:
2016-01-29
Last reply:
2016-01-29
Best Alex Rousskov (rousskov) said : #1

The host transaction (libecap::host::Xaction) implements libecap::Options API to deliver meta headers (a.k.a. annotations) to adapter transactions. See libecap/common/options.h for more info about this interface. Please note that it is the same Options API that is used to configure adapter Services.

Here is an example of an adapter transaction code extracting and printing the value of some custom X-Foo annotation (which could be set by adaptation_meta if you are using Squid):

    static const libecap::Name fooName("X-Foo");
    const libecap::Area fooValue = hostx->option(fooName);
    DebugStream() << "X-Foo: " << fooValue << "\n";

where `hostx` is the host transaction pointer passed by the host application to the adapter Service::makeXaction() method that creates adapter transactions.

manoj (manojmaybe000) said : #2

Thanks Alex Rousskov, that solved my question.