eCAP instance in squid

Asked by sam

Dear Friends
    How squid create instance from eCAP in response mode ?
Does it create NEW INSTANCE for every response session ? or What ?

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alex Rousskov (rousskov) said :
#1

There are many types of eCAP objects or instances. I am not sure which one you are asking about. I will describe two of them:

* You adapter library creates Service object(s) upon loading. This is usually done once via C++ static initialization. Look for libecap::RegisterVersionedService() calls in recent adapters, including adapter samples.

* Your Service::makeXaction() method creates adapter transaction objects. This method is called by the host application once for every message that needs adaptation. Look for Service::makeXaction() methods in adapters, including adapter samples.

Revision history for this message
sam (sadegh-sal) said :
#2

May I have 2 different eCAP adaption . the One for modifying gzip content and the other for modifying plain text content ??

Revision history for this message
Alex Rousskov (rousskov) said :
#3

Yes, you may have

* a single adaptation service that performs N actions,
* N adaptation services, each performing one action, and
* any combination of the above

provided your host application supports chaining of adaptation services. IIRC, Squid, for example, supports adaptation chains.

Normally, an adaptation service is identified by its URI. Two different services should have different URIs and, hence, should correspond to two different libecap Service objects/instances.

Revision history for this message
sam (sadegh-sal) said :
#4

OK great .
I have 2 different adaption with different URI
my example /etc/squid.config is :

ecap_enable on
loadable_modules /usr/local/lib/ecap_ecapModifier1.so
ecap_service PACO_SIM respmod_precache 1 ecap://www.deltaglobal.net/ecapModifier1
------------adaptation_access ecapModifier1 allow all

ecap_enable on
loadable_modules /usr/local/lib/ecap_ecapModifier2.so
ecap_service PACO_SIM respmod_precache 2 ecap://www.deltaglobal.net/ecapModifier2
-----------adaptation_access ecapModifier2 allow all

I dont how to say gzip content go to ecapModifier1 AND
 the rest go to ecapModifier2

Revision history for this message
Alex Rousskov (rousskov) said :
#5

You last question is not about eCAP but about Squid. You should replace the "all" ACL in your adaptation_access rule(s) with appropriate ACL(s) that detect compressed content (e.g., by matching response Content-Encoding header).

If you cannot figure it out, please use Squid support channels for help.

Can you help with this problem?

Provide an answer of your own, or ask sam for more information if necessary.

To post a message you must log in.