|
reSIProcate/repro
9694
|
#include <RecursiveRedirect.hxx>


Public Member Functions | |
| RecursiveRedirect () | |
| virtual | ~RecursiveRedirect () |
| virtual processor_action_t | process (RequestContext &) |
Definition at line 9 of file RecursiveRedirect.hxx.
| RecursiveRedirect::RecursiveRedirect | ( | ) |
Definition at line 20 of file RecursiveRedirect.cxx.
: Processor("RecursiveRedirectHandler") {}
| RecursiveRedirect::~RecursiveRedirect | ( | ) | [virtual] |
Definition at line 25 of file RecursiveRedirect.cxx.
{}
| Processor::processor_action_t RecursiveRedirect::process | ( | RequestContext & | context | ) | [virtual] |
Implements repro::Processor.
Definition at line 30 of file RecursiveRedirect.cxx.
{
DebugLog(<< "Lemur handling request: " << *this
<< "; reqcontext = " << context);
const SipMessage* response = dynamic_cast<const SipMessage*>(context.getCurrentEvent());
if (response &&
response->isResponse() &&
response->header(h_StatusLine).statusCode() / 100 == 3)
{
TargetPtrList batch;
for (NameAddrs::const_iterator i=response->header(h_Contacts).begin();
i != response->header(h_Contacts).end(); ++i)
{
if(i->isWellFormed() && !i->isAllContacts())
{
QValueTarget* target = new QValueTarget(*i);
batch.push_back(target);
}
}
if(!batch.empty())
{
#ifdef __SUNPRO_CC
sort(batch.begin(), batch.end(), Target::priorityMetricCompare);
#else
batch.sort(Target::priorityMetricCompare);
#endif
context.getResponseContext().addTargetBatch(batch);
//ResponseContext should be consuming the vector
assert(batch.empty());
}
return Processor::SkipAllChains;
}
return Processor::Continue;
}
1.7.5.1