Post Reply 
Problem with $SET & $TST
Jan. 10, 2006, 11:31 AM
Post: #1
Problem with $SET & $TST
Hi all

I'm having a problem checking a flag with $SET and $TST.

Here's some filters that demonstrate:

Code:
[Patterns]

Name = "SET Test 1"
Active = FALSE
URL = "$TYPE(htm)$SET(bHTM=1)"
Limit = 1
Match = "$STOP()"

Name = "SET Test 2"
Active = FALSE
URL = "$TYPE(htm)"
Limit = 1
Match = "$STOP()*$SET(bHTM=1)&(^?)"

Name = "Match TEST 1"
Active = TRUE
URL = "$TYPE(htm)$TST(bHTM=1)"
Bounds = "<*>"
Limit = 256
Match = "<*>$ALERT(Match 1)$STOP()&(^?)"

Name = "Match TEST 2"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<*>"
Limit = 256
Match = "<*>$TST(bHTM=1)$ALERT(Match 2)$STOP()&(^?)"


If "SET Test 1" is made Active, both "Match Test 1 & 2" filters match as expected.

If instead, "SET Test 2" is made Active, only "Match Test 2" filter matches.

Whats up with that?

Mike
Add Thank You Quote this message in a reply
Jan. 10, 2006, 05:05 PM
Post: #2
 
I think it's a question of timing.
First the URL Matches and then the Matching Expressions.
Quote:If instead, "SET Test 2" is made Active, only "Match Test 2" filter matches.
"Match Test 1" is testing before bHTM has been set.

Try
Code:
[Patterns]
Name = "SET Test 1"
Active = FALSE
URL = "$TYPE(htm)$SET(bHTM=1)$LOG(RSET Test 1)"
Limit = 1
Match = "$STOP()"

Name = "SET Test 2"
Active = FALSE
URL = "$TYPE(htm)"
Limit = 1
Match = "$STOP()*$SET(bHTM=1)$LOG(RSET Test 2)$ALERT(Test 2)&(^?)"

Name = "Match TEST 1"
Active = TRUE
URL = "$TYPE(htm)$LOG(RMatch Test 1)$TST(bHTM=1)"
Bounds = "<*>"
Limit = 256
Match = "<*>$ALERT(Match 1)$STOP()&(^?)"

Name = "Match TEST 2"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<*>"
Limit = 256
Match = "<*>$LOG(RMatch Test 2)$TST(bHTM=1)$ALERT(Match 2)$STOP()&(^?)"
and watch the Log window.

HTH
Add Thank You Quote this message in a reply
Jan. 12, 2006, 12:42 AM
Post: #3
 
Hi JJoe

Sorry for the late reply, had to go out of town.

Here's what I get with the filters you posted.

Quote:Match Test 1
SET Test 2
Match Test 2

hmm...

I think it's a bit more than a timing issue.

I removed the $STOP() from "Match TEST 1" like so:

Quote:[Patterns]
Name = "Match TEST 1"
Active = TRUE
URL = "$TYPE(htm)$LOG(RMatch Test 1)$TST(bHTM=1)"
Bounds = "<*>"
Limit = 256
Match = "<*>$ALERT(Match 1)&(^?)"

I still don't get an alert from this filter.

This indicates to me that the URL match is only checked once. If the URL match fails, the filter is never checked again.

From the perspective of speeding up filtering, this makes sense as the URL for any given connection won't change.

So I guess the moral of this test is:

If you set a flag in a Match expression, it can only be reliably tested in another Match expression, not a URL expression.

Any thoughts?

Mike
Add Thank You Quote this message in a reply
Jan. 12, 2006, 03:33 PM
Post: #4
 
All URL fields are evaluated before all Matching Expressions, so you can't $SET something in a ME and $TST it in a UF.
Add Thank You Quote this message in a reply
Jan. 12, 2006, 05:44 PM
Post: #5
 
z12 Wrote:Any thoughts?

Why can't they put good music on the radio...
You call that music?!

I still see it as a question of timing.

The data for the URL Match comes streaming in.
As it does, Proxomitron checks each filter's URL Match against it.
At this point, bHTM has not been set, so the filter fails.
Proxomitron then sends the data on to the browser.
So at this point, URL Matches are done. The data is gone.
"Match TEST 1" has failed and will not be used.

Then the data for the Matching Expressions comes streaming in...

So things done in the Matching Expressions can't be considered in the URL Matches because they haven't happened yet.

I think the moral is:

If you set a flag in a Match expression, it can only be tested in another Match expression, not a URL expression.

HTH
Add Thank You Quote this message in a reply
Jan. 12, 2006, 06:55 PM
Post: #6
 
Ok, just wanted to make sure.

Thanks for the help
Mike
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: