MCPcopy Create free account
hub / github.com/apache/brpc / PercentDecode

Function PercentDecode

src/brpc/grpc.cpp:154–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void PercentDecode(const std::string& str, std::string* str_out) {
155 std::ostringstream unescaped;
156 for (std::string::const_iterator it = str.begin();
157 it != str.end(); ++it) {
158 const std::string::value_type& c = *it;
159 if (c == '%' && it + 2 < str.end()) {
160 int i1 = hex_to_int(*++it);
161 int i2 = hex_to_int(*++it);
162 unescaped << (char)(i1 * 16 + i2);
163 } else {
164 unescaped << c;
165 }
166 }
167 if (str_out) {
168 *str_out = unescaped.str();
169 }
170}
171
172int64_t ConvertGrpcTimeoutToUS(const std::string* grpc_timeout) {
173 if (!grpc_timeout || grpc_timeout->empty()) {

Callers 2

TEST_FFunction · 0.85
ProcessHttpResponseFunction · 0.85

Calls 3

hex_to_intFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TEST_FFunction · 0.68