Asked by manoj

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

English Edit question
eCAP Edit question
No assignee Edit question
Solved by:
Alex Rousskov
Last query:
Last reply:
Revision history for this message
Best Alex Rousskov (rousskov) said :

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.

Revision history for this message
manoj (manojmaybe000) said :

Thanks Alex Rousskov, that solved my question.