Forum Discussion
Variable Scope with HTTP requests and collected data
That seems quite anoying but I must just be over/under thinking it.
One of the toughest things I had to grasp, as a traditional programmer learning iRules, is that iRules don't follow the same "flow" paradigm that other modern languages follow. True to form, an iRule "script" flows procedurally from top to bottom like any other program, but it does so in the context of network flow. Events are triggered in the context of the OSI layer that they represent. CLIENT ACCEPTED (layer 4) happens first, then CLIENTSSL_HANDSHAKE (layer 6 - and if offloading SSL), then HTTP_REQUEST, HTTP_REQUEST_DATA if triggered by an HTTP::collect, the LB:: events in the middle, HTTP_REQUEST_SEND and _RELEASE, and then proceeding into the server side context with SERVER_CONNECTED (layer 4), and finally HTTP_RESPONSE (layer 7). If you think of it in this "left to right" sort of way, then it starts to make sense how IP information is available to an HTTP_REQUEST event, but HTTP URI is not available in CLIENT_ACCEPTED.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com