MCPcopy Create free account
hub / github.com/apache/trafficserver / rxscope

Method rxscope

plugins/experimental/stream_editor/stream_editor.cc:226–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224
225public:
226 rxscope(const bool u, const bool i, const char *pattern, int len) : scope_t(u)
227 {
228 int flags = REG_NOSUB | REG_EXTENDED | (i ? REG_ICASE : 0);
229 char *str = TSstrndup(pattern, len);
230 int error = regcomp(&rx, str, flags);
231 if (error) {
232 TSError("stream-editor: can't compile regexp [%s]", str);
233 TSfree(str);
234 throw std::runtime_error("stream editor: Error compiling regex, regcomp in rxscope");
235 }
236 TSfree(str);
237 }
238
239 ~rxscope() override { regfree(&rx); }
240};

Callers

nothing calls this directly

Calls 3

TSstrndupFunction · 0.85
TSfreeFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected