Merge pull request #1849 from nghttp2/remove-unused-function
Remove unused function
This commit is contained in:
commit
05b7929019
|
@ -152,8 +152,6 @@ int main(int argc, char *argv[]) {
|
||||||
!CU_add_test(pSuite, "util_to_token68", shrpx::test_util_to_token68) ||
|
!CU_add_test(pSuite, "util_to_token68", shrpx::test_util_to_token68) ||
|
||||||
!CU_add_test(pSuite, "util_percent_encode_token",
|
!CU_add_test(pSuite, "util_percent_encode_token",
|
||||||
shrpx::test_util_percent_encode_token) ||
|
shrpx::test_util_percent_encode_token) ||
|
||||||
!CU_add_test(pSuite, "util_percent_encode_path",
|
|
||||||
shrpx::test_util_percent_encode_path) ||
|
|
||||||
!CU_add_test(pSuite, "util_percent_decode",
|
!CU_add_test(pSuite, "util_percent_decode",
|
||||||
shrpx::test_util_percent_decode) ||
|
shrpx::test_util_percent_decode) ||
|
||||||
!CU_add_test(pSuite, "util_quote_string",
|
!CU_add_test(pSuite, "util_quote_string",
|
||||||
|
|
16
src/util.cc
16
src/util.cc
|
@ -135,22 +135,6 @@ std::string percent_encode(const std::string &target) {
|
||||||
target.size());
|
target.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string percent_encode_path(const std::string &s) {
|
|
||||||
std::string dest;
|
|
||||||
for (auto c : s) {
|
|
||||||
if (in_rfc3986_unreserved_chars(c) || in_rfc3986_sub_delims(c) ||
|
|
||||||
c == '/') {
|
|
||||||
dest += c;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
dest += '%';
|
|
||||||
dest += UPPER_XDIGITS[(c >> 4) & 0x0f];
|
|
||||||
dest += UPPER_XDIGITS[(c & 0x0f)];
|
|
||||||
}
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool in_token(char c) {
|
bool in_token(char c) {
|
||||||
static constexpr char extra[] = {'!', '#', '$', '%', '&', '\'', '*', '+',
|
static constexpr char extra[] = {'!', '#', '$', '%', '&', '\'', '*', '+',
|
||||||
'-', '.', '^', '_', '`', '|', '~'};
|
'-', '.', '^', '_', '`', '|', '~'};
|
||||||
|
|
|
@ -106,9 +106,6 @@ std::string percent_encode(const unsigned char *target, size_t len);
|
||||||
|
|
||||||
std::string percent_encode(const std::string &target);
|
std::string percent_encode(const std::string &target);
|
||||||
|
|
||||||
// percent-encode path component of URI |s|.
|
|
||||||
std::string percent_encode_path(const std::string &s);
|
|
||||||
|
|
||||||
template <typename InputIt>
|
template <typename InputIt>
|
||||||
std::string percent_decode(InputIt first, InputIt last) {
|
std::string percent_decode(InputIt first, InputIt last) {
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
|
@ -144,11 +144,6 @@ void test_util_percent_encode_token(void) {
|
||||||
util::percent_encode_token(balloc, StringRef::from_lit("http 2")));
|
util::percent_encode_token(balloc, StringRef::from_lit("http 2")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_util_percent_encode_path(void) {
|
|
||||||
CU_ASSERT("/foo1/bar%3F&/%0A" == util::percent_encode_path("/foo1/bar?&/"
|
|
||||||
"\x0a"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void test_util_percent_decode(void) {
|
void test_util_percent_decode(void) {
|
||||||
{
|
{
|
||||||
std::string s = "%66%6F%6f%62%61%72";
|
std::string s = "%66%6F%6f%62%61%72";
|
||||||
|
|
|
@ -37,7 +37,6 @@ void test_util_inp_strlower(void);
|
||||||
void test_util_to_base64(void);
|
void test_util_to_base64(void);
|
||||||
void test_util_to_token68(void);
|
void test_util_to_token68(void);
|
||||||
void test_util_percent_encode_token(void);
|
void test_util_percent_encode_token(void);
|
||||||
void test_util_percent_encode_path(void);
|
|
||||||
void test_util_percent_decode(void);
|
void test_util_percent_decode(void);
|
||||||
void test_util_quote_string(void);
|
void test_util_quote_string(void);
|
||||||
void test_util_utox(void);
|
void test_util_utox(void);
|
||||||
|
|
Loading…
Reference in New Issue