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

Method referer_info

src/proxy/http/remap/UrlMapping.cc:159–190  ·  view source on GitHub ↗

* **/

Source from the content-addressed store, hash-verified

157 *
158 **/
159referer_info::referer_info(const char *_ref, bool *error_flag, char *errmsgbuf, int errmsgbuf_size)
160{
161 std::string error;
162 int erroffset;
163
164 if (error_flag) {
165 *error_flag = false;
166 }
167
168 if (_ref) {
169 if (*_ref == '~') {
170 negative = true;
171 _ref++;
172 }
173 if ((referer = ats_strdup(_ref)) != nullptr) {
174 referer_size = strlen(referer);
175 if (!strcmp(referer, "*")) {
176 any = true;
177 } else {
178 regex_valid = regex.compile(referer, error, erroffset, RE_CASE_INSENSITIVE);
179 if (regex_valid == false) {
180 if (errmsgbuf && (errmsgbuf_size - 1) > 0) {
181 ink_strlcpy(errmsgbuf, error.c_str(), errmsgbuf_size);
182 }
183 if (error_flag) {
184 *error_flag = true;
185 }
186 }
187 }
188 }
189 }
190}
191
192/**
193 *

Callers

nothing calls this directly

Calls 4

strcmpFunction · 0.85
ink_strlcpyFunction · 0.85
compileMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected