src: Remove lookup_token(const std::string&)

This commit is contained in:
Tatsuhiro Tsujikawa 2016-03-25 23:29:16 +09:00
parent f74d7ea119
commit 00b2d7d513
3 changed files with 6 additions and 10 deletions

View File

@ -574,11 +574,6 @@ int parse_http_status_code(const StringRef &src) {
return status;
}
int lookup_token(const std::string &name) {
return lookup_token(reinterpret_cast<const uint8_t *>(name.c_str()),
name.size());
}
int lookup_token(const StringRef &name) {
return lookup_token(name.byte(), name.size());
}

View File

@ -302,7 +302,6 @@ using HeaderIndex = std::array<int16_t, HD_MAXIDX>;
// Only headers we are interested in are tokenized. If header name
// cannot be tokenized, returns -1.
int lookup_token(const uint8_t *name, size_t namelen);
int lookup_token(const std::string &name);
int lookup_token(const StringRef &name);
// Initializes |hdidx|, header index. The |hdidx| must point to the

View File

@ -271,10 +271,12 @@ void test_http2_index_header(void) {
}
void test_http2_lookup_token(void) {
CU_ASSERT(http2::HD__AUTHORITY == http2::lookup_token(":authority"));
CU_ASSERT(-1 == http2::lookup_token(":authorit"));
CU_ASSERT(-1 == http2::lookup_token(":Authority"));
CU_ASSERT(http2::HD_EXPECT == http2::lookup_token("expect"));
CU_ASSERT(http2::HD__AUTHORITY ==
http2::lookup_token(StringRef::from_lit(":authority")));
CU_ASSERT(-1 == http2::lookup_token(StringRef::from_lit(":authorit")));
CU_ASSERT(-1 == http2::lookup_token(StringRef::from_lit(":Authority")));
CU_ASSERT(http2::HD_EXPECT ==
http2::lookup_token(StringRef::from_lit("expect")));
}
void test_http2_parse_link_header(void) {