Rules processing and flow control

A virtual server may be configured to run several request or response rules. In this case, the rules are executed in turn, unless a terminal action such as connection.close() is called.

Quite often, it's necessary to stop processing a rule and proceed to the next rule. For example, you might have a lengthy rule which only applies to requests for /secure content:

$url = http.getPath();
if( string.startsWith( $url, "/secure" ) {
  ...
  ...
  ...
}

It's more elegant to use the 'break' statement to stop processing the current rule if the condition is not met:

$url = http.getPath();
if( !string.startsWith( $url, "/secure" ) ) break;

...
...
...

You can also use the 'continue' statement to restart the current rule.

Owen Garrett [Zeus Dev Team] 01 July 2005  Permalink  
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)
Download Free ZXTM Desktop Edition

Recent Articles

Other Resources



www.zeus.com