Hi
I have a v4.5 iRule using ‘accumulate’ that needs
to be upgraded to v9.1.
this is the rule:
}
else if (http_content_collected < 20) {
log “accumulating…”
accumulate
}
Is there an equivilent function in v9?
Thanks
Hi
I have a v4.5 iRule using ‘accumulate’ that needs
to be upgraded to v9.1.
this is the rule:
}
else if (http_content_collected < 20) {
log “accumulating…”
accumulate
}
Is there an equivilent function in v9?
Thanks
Since v9 is event driven the new equivalent is to simply reissue another TCP::collect in the CLIENT_DATA event.
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
if { [TCP::payload length] < 20 } {
TCP::collect
} else {
...
}
}
You can equivalently tell it to collect at least 20 bytes to begin with:
when CLIENT_ACCEPTED {
TCP::collect 20
}
when CLIENT_DATA {
if { [TCP::payload] contains "foo" } {
...
}
}
Hope this helps!
Oh, sorry, I just realized your example was for referencing http content. The same rules apply, just use the “HTTP::” equivalent commands: HTTP::collect and HTTP::payload and the HTTP_REQUEST_DATA event.
when HTTP_REQUEST {
HTTP::collect
}
when HTTP_REQUEST_DATA {
if { [HTTP::payload length] < 20 } {
HTTP::collect
} else {
...
}
}