Couldn't get Header value -- Error occured "ICAP protocol error"
Hi All,
I am new to ECAP lib and working on sample content adapter "ecap_adapter_
1. OS: Centos5.0
2. Squid: 3.1.0.6
3. libecap: 0.0.2
I am trying to get the header field for a browser request, say "Host: www.google.com", where name is "Host" and value is "www.google.com". My code is as:
void Adapter:
Must(hostx);
if (hostx-
receivingVb = opOn;
hostx->vbMake(); // ask host to supply virgin body
} else {
receivingVb = opNever;
}
libecap:
Must(adapted != 0);
adapted-
// add a custom header
static const libecap::Name name("X-Ecap");
const libecap:
libecap:
adapted-
cout << "1. I am at "<< __LINE__ << endl;
const libecap::Name name2("Host");
libecap:
cout << "2. I am at "<< __LINE__ << endl;
value1 = adapted-
if (!adapted->body()) {
sendingAb = opNever; // there is nothing to send
lastHostCall(
} else {
hostx-
}
}
When the execution reaches at line "cout << "2. I am at "<< __LINE__ << endl;", It displays the following error on browser:
------------------
ICAP protocol error.
The system returned: [No Error]
This means that some aspect of the ICAP communication failed.
Some possible problems are:
* The ICAP server is not reachable.
* An Illegal response was received from the ICAP server.
------------------
please suggest me what I am doing wrong? I think there is a bug in value() function.
Any help would be greatly appreciated.
Thanks in advance.
Ali Muhammad
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- eCAP Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ali Mohammad
- Solved:
- Last query:
- Last reply: