Forum Discussion

Farid_Lahdiri_1's avatar
Farid_Lahdiri_1
Icon for Nimbostratus rankNimbostratus
Nov 22, 2006

V9 iRule

Hi all,

 

 

I have a V4 iRule (see excerpt in the bottom) that works properly when I ported it to V9 part of it (the URI::decode) is failing.

 

 

Here is an excerpt of the V9 rule:

 

---------------

 

if { [HTTP::method] == "POST" } {

 

set HTTP_CONTENT [HTTP::payload 40]

 

set M_notifyresp_ind [ URI::decode ("%8c%83%98")]

 

set MMS_RES [ string range $HTTP_CONTENT 0 2]

 

if {($MMS_RES == $M_notifyresp_ind )} { <==== Always fails

 

---------------

 

Debugging this, here is what I found:

 

M_notifyresp_ind = \x8c\x83\x98 is a string of 3 8-bit hex values.

 

 

From tcpdump, I see that the client does send the same hex values but they are 16-bit values and they look like: c28c c283 and c298 this obviously makes my "if {($MMS_RES == $M_notifyresp_ind )}" statement always fail!.

 

My workaround is to redefine M_notifyresp_ind variable as follows:

 

set M_notifyresp_ind \x8c\x83\x98 - but I want to know what:

 

1- Have I missunderstood the use of the URI::decode fonction

 

2- Has it changed in V9 (compared to its fuctionality in V4)

 

 

In comparison here is an excerpt of the rule in V4:

 

 

if (http_method == "POST") {

 

if (substr(http_content(4), 0, 3) == decode_uri("%8c%83%98")) {

 

 

And this works properly.

 

 

Any comments on this will be appreciated.

 

Regards.

 

 

/Farid

 

No RepliesBe the first to reply