Forum Discussion
Robert_47833
Aug 01, 2011Altostratus
Hi,Bhattman
1:can u tell me why item1 has improved
set rand [expr { rand() }]
I have changed it as
set BigipABurl_cookie ""
if {[class match $uri starts_with gen3abURLs_SRWD29]} {
set rand [expr { rand() }]
switch -glob [HTTP::cookie BigipABurl_cookie] {
"1" {
pool SRWD29-G3-BRX
return
}
"2" {
pool SRWD29-BROWSE
return
}
default {
if { $rand <0.2 } {
pool SRWD29-G3-BRX
set BigipABurl_cookie 1
return
}
else {
pool SRWD29-BROWSE
set BigipABurl_cookie 2
return
}
}
}
}
when HTTP_RESPONSE {
if {$BigipABurl_cookie ne "" } {
HTTP::cookie insert name BigipABurl_cookie value $BigipABurl_cookie path "/"
}
2:I have changed it as:
when HTTP_REQUEST timing on {
set uri [string tolower [HTTP::uri]]
if {[class match $uri starts_with gen3abURLs_SRWD29] } {
if {[HTTP::cookie value_cookie] ne "" } {
pool cjjlb member $value_cookie
}
else {
pool cjjb
}
}
when LB_SELECTED {
set lbvalue "[LB::server_addr] [LB::server port]"
when HTTP_RESPONSE {
if {$lbvalue ne "" } {
HTTP::cookie insert name value_cookie value $lbvalue path "/"
}
}
for this method,I have a question
we didn't define $value_cookie
also I want to know when n variable will change during the connection
for example ,we define $value_cookie ,and it get a value in http_request,we can find this value in http_response