Forum Discussion
BlurredVision_1
Nimbostratus
Mar 11, 2008HTTP Double Dipping...
All,
I know this is a crazy corner case, and that there are probably 100 ways to do this with the app, the application guys are looking for some f5 lovin to get this working as a short term workarou...
BlurredVision_1
Nimbostratus
Mar 12, 2008Worked a charm.. here is the final iRule for the annals of history:
when RULE_INIT {
HTTP Double Dip
Turn logging on or off (0=off, 1=on)
set ::debug 1
if { $::debug } {log local0. "" }
}
when CLIENT_ACCEPTED {
set retrying 0
if { $::debug } {log local0. "Resetting Iteration and Replay to 0"}
}
when HTTP_REQUEST {
if { $::debug } {log local0. "Entering HTTP_REQUEST" }
Unchunk
set HTTP::version "1.0"
if { $::debug } {log local0. "Setting HTTP version 1.0" }
Store the request into a variable
set request [HTTP::request]
if { $::debug } {log local0. " HTTP Request: $request" }
check to see if replay trigger is set
if { $retrying == 0 } {
If replay trigger *IS NOT* set, play the connection to V2 first
pool Pool-V2
if { $::debug } {log local0. "Retrying = $retrying, sending request to [LB::server pool] " }
} elseif { $retrying == 1} {
If replay trigger *IS* set, play the connection to V1
pool Pool-V1
if { $::debug } {log local0. "Retrying = $retrying, sending request to [LB::server pool] " }
}
if { $::debug } {log local0. "Leaving HTTP_REQUEST" }
}
when HTTP_RESPONSE {
if { $::debug } {log local0. "Enternig HTTP_RESPONSE" }
if { $::debug } {log local0. "HTTP Response from [LB::server pool] of [HTTP::status]" }
Check to see if we are set to play to V1
if { $::debug } {log local0. "Starting Retrying assesment." }
if { [ LB::server pool] eq "Pool-V1" } {
if { $::debug } {log local0. "Response is from [ LB::server pool ] " }
set retrying 0
return
} else {
set retrying 1
if { $::debug } {log local0. "Retrying = $retrying" }
if { $::debug } {log local0. "Initiating HTTP::retry" }
HTTP::retry $request
}
if { $::debug } {log local0. "Exiting HTTP_RESPONSE"
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects