Forum Discussion
Stanislas_Piro2
Mar 05, 2018Cumulonimbus
The problem is TNS have header length value you have to update. Try this new version code:
when CLIENT_ACCEPTED {
set collected_length 0
set virtual_ip [IP::local_addr]
}
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
set tns_data [TCP::payload]
Detect if the response is a redirect
if {[binary scan $tns_data SSccSSA* packet_length packet_checksum type reserved_byte header_checksum redirect_length redirect_data] == 7 && $type == 5} {
if {[set host_start [string first "(HOST=" $redirect_data]] != -1 && [set host_end [string first ")" $redirect_data $host_start]] != -1} {
set new_redirect_data [string replace $redirect_data $host_start $host_end "(HOST=$virtual_ip)"]
set new_redirect_length [string length $new_redirect_data]
TCP::payload replace 0 [TCP::payload length] [binary format SSccSSA* [expr {$new_redirect_length+10}] $packet_checksum $type $reserved_byte $header_checksum $new_redirect_length $new_redirect_data]
}
}
TCP::release
if {$collected_length < 2048} {
TCP::collect
}
}