File tree 2 files changed +6
-0
lines changed
doc/developer-guide/cripts
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ Macro Traditional API equivalent
118
118
=========================== ====================================================================
119
119
``Regex(name, ...) `` ``static cripts::Matcher::PCRE name(...) ``
120
120
``ACL(name, ...) `` ``static cripts::Matcher::Range::IP name(...) ``
121
+ ``StatusCode(code, ...) `` ``cripts::Error::Status::Set(code, ...) ``
121
122
``CreateCounter(id, name) `` ``instance.metrics[id] = cripts::Metrics::Counter::Create(name) ``
122
123
``CreateGauge(id, name) `` ``instance.metrics[id] = cripts::Metrics::Gauge::Create(name) ``
123
124
``FilePath(name, path) `` ``static const cripts::File::Path name(path) ``
@@ -138,3 +139,7 @@ An example of using ACLs and regular expressions:
138
139
// do something
139
140
}
140
141
}
142
+ .. note ::
143
+ The ``StatusCode `` macro currently only works with the status code, the reason
144
+ message can not be set or overridden. Fixing this will require a future change
145
+ in the Traffic Server code base.
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ extern cripts::Versions version; // Access to the ATS version information
116
116
#define urls context->_urls
117
117
#define Regex (_name_, ...) static cripts::Matcher::PCRE _name_ (__VA_ARGS__);
118
118
#define ACL (_name_, ...) static cripts::Matcher::Range::IP _name_ (__VA_ARGS__);
119
+ #define StatusCode (_name_, ...) cripts::Error::Status::Set(_name_, __VA_ARGS__);
119
120
#define CreateCounter (_id_, _name_ ) instance.metrics[_id_] = cripts::Metrics::Counter::Create(_name_);
120
121
#define CreateGauge (_id_, _name_ ) instance.metrics[_id_] = cripts::Metrics::Gauge::Create(_name_);
121
122
#define FilePath (_name_, _path_ ) static const cripts::File::Path _name_ (_path_);
You can’t perform that action at this time.
0 commit comments