I need documentation on eCAP

Asked by Lucian Bazoi

Hi all,

  I'm new to content adaptation. I need to inspect the content of a form in some web pages. I need to see what the user enters.
  I am using squid Proxy server for this.
Can someone help me with some documentation or some examples on eCAP? I couldn't find anything. I only have the code, ecap_adapter_sample-0.0.2
  I understand that eCAP server better my purpose than ICAP

  I was able to see the POSTs on Squid proxy server but I can't analyze the content in Squid code.

Thank you,
Lucian

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

Current documentation consists of this site, brief notes on e-cap.org, documented source code APIs, and samples. It is clearly not very detailed but it is often sufficient for adapter implementation.

The "modifying" eCAP adapter sample is an example of how the message body may be examined (and modified). You can start with the sample and use documented source to reshape it into the adapter you need. Most of the hooks you need are already used by that sample adapter. You just need to use them differently. If you are stuck, please ask specific questions here.

Revision history for this message
Lucian Bazoi (dezvoltator) said :
#2

Where do I find the documented source code APIs?

Thank you.

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

libecap-0.0.3 tarball contains the library sources which define eCAP API. Most of the public methods have telling names, comments describing their purpose or both. For example, here is the part of the adapter transaction API in libecap-0.0.3/src/libecap/adapter/xaction.h that controls adapted body exchange with the host side of the transaction:

  // adapted body transmission control
  virtual void abDiscard() = 0; // host will not look at ab at all
  virtual void abMake() = 0; // host may look at ab
  virtual void abMakeMore() = 0; // host must have more ab
  virtual void abStopMaking() = 0; // host no longer needs ab
  virtual void abPause() {} // ignored by default
  virtual void abResume() {}; // ignored iff abPause is

If you combine the above with overview notes on the e-cap.org site and sample adapters that implement these methods, you should be able to see the whole picture and the specific hooks that make eCAP tick. This is clearly far from detailed docs or tutorials, but is sufficient in many cases.

Better documentation contributions are welcomed.

Revision history for this message
Lucian Bazoi (dezvoltator) said :
#4

Hi,
I'm having difficulties seeing even parts of the picture.
I need to get the entire virgin body. Is that possible?
In which function of the adapter can I accumulate the vb chunks?
I need to call a function to analyze the body and the function takes 3-4 seconds to complete. Can that call be made from the function void Adapter::Xaction::start() ?
How can I add some threads, what would be the design, the data structures involved?
Thank you a lot.

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

It is better to ask one question per Question. This way, it would be much easier for others to find answers.

Yes, it is possible to get the entire virgin body. For example, the Modifying Adapter from the Sample works with the entire virgin body, accumulating it in the "buffer" member. Modifying Adapter does not always keep the entire accumulated body (it offers accumulated portions to the host), but yours can.

You may accumulate vb chunks in adapter::Xaction::noteVbContentAvailable().

You should not try to analyze the virgin body in adapter::Xaction::start() because the body may not be available at that time (it may still be coming from the client or server).

If any of the adapter methods blocks while waiting for something, the host application (or the calling strand of the host application, to be precise) may block as well.

You can thread your adapter, but there is currently no API to asynchronously tell the host application that the adapter wants to talk to the host. All communications are currently host-driven. We plan to add such an API call to help with threaded adapters. I recommend that you build and polish a non-threaded but thread-safe version of the adapter first. If you find thread-unsafe code in libecap, please open a bug report.

Can you help with this problem?

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

To post a message you must log in.