Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: net/base/ssl_false_start_blacklist.cc

Issue 10014010: net: False Start only for NPN capable servers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/ssl_false_start_blacklist.h"
6
7 namespace net {
8
9 // static
10 bool SSLFalseStartBlacklist::IsMember(const std::string& host) {
11 const std::string last_two_components(LastTwoComponents(host));
12 if (last_two_components.empty())
13 return false;
14
15 const size_t bucket = Hash(last_two_components) & (kBuckets - 1);
16 for (size_t i = kHashTable[bucket]; i < kHashTable[bucket + 1]; ) {
17 const size_t blacklist_entry_len = static_cast<uint8>(kHashData[i]);
18 if (host.length() >= blacklist_entry_len &&
19 !host.compare(host.length() - blacklist_entry_len, blacklist_entry_len,
20 &kHashData[i + 1], blacklist_entry_len) &&
21 (host.length() == blacklist_entry_len ||
22 host[host.length() - blacklist_entry_len - 1] == '.')) {
23 return true;
24 }
25 i += blacklist_entry_len + 1;
26 }
27
28 return false;
29 }
30
31 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698