|
16 | 16 |
|
17 | 17 | #include "jaegertracing/testutils/MockAgent.h"
|
18 | 18 |
|
19 |
| -#include <regex> |
20 | 19 | #include <thread>
|
21 | 20 |
|
22 | 21 | #include <thrift/protocol/TCompactProtocol.h>
|
|
28 | 27 | #include "jaegertracing/net/http/Request.h"
|
29 | 28 | #include "jaegertracing/net/http/Response.h"
|
30 | 29 | #include "jaegertracing/utils/ErrorUtil.h"
|
| 30 | +#include "jaegertracing/utils/Regex.h" |
31 | 31 | #include "jaegertracing/utils/UDPClient.h"
|
32 | 32 |
|
33 | 33 | namespace jaegertracing {
|
@@ -139,7 +139,7 @@ void MockAgent::serveHTTP(std::promise<void>& started)
|
139 | 139 | _servingHTTP = true;
|
140 | 140 | started.set_value();
|
141 | 141 |
|
142 |
| - const std::regex servicePattern("[?&]service=([^?&]+)"); |
| 142 | + const regex_namespace::regex servicePattern("[?&]service=([^?&]+)"); |
143 | 143 | while (isServingHTTP()) {
|
144 | 144 | constexpr auto kBufferSize = 256;
|
145 | 145 | std::array<char, kBufferSize> buffer;
|
@@ -167,11 +167,12 @@ void MockAgent::serveHTTP(std::promise<void>& started)
|
167 | 167 | _httpAddress.authority() + "/baggageRestrictions")) {
|
168 | 168 | resource = Resource::kBaggage;
|
169 | 169 | }
|
170 |
| - std::smatch match; |
171 |
| - if (!std::regex_search(target, match, servicePattern)) { |
| 170 | + regex_namespace::smatch match; |
| 171 | + if (!regex_namespace::regex_search(target, match, servicePattern)) { |
172 | 172 | throw net::http::ParseError("no 'service' parameter");
|
173 | 173 | }
|
174 |
| - if (std::regex_search(match.suffix().str(), servicePattern)) { |
| 174 | + if (regex_namespace::regex_search( |
| 175 | + match.suffix().str(), servicePattern)) { |
175 | 176 | throw net::http::ParseError(
|
176 | 177 | "'service' parameter must occur only once");
|
177 | 178 | }
|
|
0 commit comments