User Tools

Site Tools


cookbooks:devel:pseudovariables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cookbooks:devel:pseudovariables [2021/02/20 10:58] jihcookbooks:devel:pseudovariables [2021/04/03 06:31] – [$rc - Returned code] miconda
Line 437: Line 437:
 **$retcode** - same as **$rc** **$retcode** - same as **$rc**
  
 +Note that the value of $rc is overwritten by each new function call.
 +
 +Example of use:
 +
 +<code c>
 + lookup("location");
 + $var(rc) = $rc;
 + if ($var(rc) < 0) {
 + t_newtran();
 + switch ($var(rc)) {
 + case -1:
 + case -3:
 + send_reply("404", "Not Found");
 + exit;
 + case -2:
 + send_reply("405", "Method Not Allowed");
 + exit;
 + }
 + }
 +
 +</code>
 ==== $rd - Domain in R-URI ==== ==== $rd - Domain in R-URI ====
  
Line 1584: Line 1605:
 ==== $T_branch_idx ==== ==== $T_branch_idx ====
  
-  * the index (starting with for the first branch) of the branch for which is executed the branch_route[]. If used outside of branch_route[] block, the value is '0'.+  * the index (starting with for the first branch) of the branch for which is executed the branch_route[]. 
 +  * in failure_route[] block, the value is the number of completed branches added to the number of new new branches 
 +  * in request_route block, the value is number of created branches 
 +  * in onreply_route[], the value is the index of the branch receiving the reply 
 +  * if used outside of transaction processing, the value is '-1'
  
 ==== $T_reply_ruid ==== ==== $T_reply_ruid ====
cookbooks/devel/pseudovariables.txt · Last modified: 2022/04/11 13:24 by henningw

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki