Forum Discussion

Stewart_Mann_11's avatar
Stewart_Mann_11
Historic F5 Account
Sep 01, 2005

Accumulate function

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

2 Replies

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    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!
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    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 {
          ...
       }
    }