Klaus_Gerthein1
Jul 20, 2011Nimbostratus
Problem with b64decode lindex in Version 10.2.1
Hello,
I would like to send a sorry page when all pool members are down. I found a solution contributed by citizen_elah .
1. Generate base64 encoded file from a screen shot .
2. Remove the newlines from the file
3. Copy the file to /var/class/
4. Create a DataGroup Extern File Type String , Mode ReadOnly (Version 10)
5. Apply the rule to the virtual server
Anything is working fine in version 9.4.7 but not in version 10.2.1 Hotfix-3.
when HTTP_REQUEST {
if {[active_members myPool] == 0} {
HTTP::respond 200 content [b64decode [lindex $::sorrypage_class 0]] "Content-Type" "image/png" }
}
}
In Version 10 I tried to access the lindex with $:: and without both was not working.
In Version 10.2.1 I always got the error message:
TEST_maintenance_site - conversion error invoked from within "b64decode [lindex sorrypage 0]"
I also tried to decode the file at rule init.
when RULE_INIT { log local0. "[b64decode [lindex test_base64 0]]" }
Produced this error: local/tmm err tmm[4831]: 01220001:3: TCL error: Test_base64_File - conversion error invoked from within "b64decode [lindex $::test_base64 0]" Encoding and decoding under linux with base64 works fine.
Any idea how to solve this ?
Thanks.
Regards Klaus