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

Unified Diff: webrtc/base/httpcommon.cc

Issue 2623473004: Replace all use of the VERIFY macro. (Closed)
Patch Set: Delete a DCHECK, instead log and return failure. And fix compile error in previous patch set. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/base/httpcommon.cc
diff --git a/webrtc/base/httpcommon.cc b/webrtc/base/httpcommon.cc
index 389bca2aa1f82389860fd49036c824bd6d5f1c9b..3d46ab2770b3470274de98d4d19931b9523a71ac 100644
--- a/webrtc/base/httpcommon.cc
+++ b/webrtc/base/httpcommon.cc
@@ -679,37 +679,6 @@ HttpResponseData::parseLeader(const char* line, size_t len) {
// Http Authentication
//////////////////////////////////////////////////////////////////////
-#define TEST_DIGEST 0
-#if TEST_DIGEST
-/*
-const char * const DIGEST_CHALLENGE =
- "Digest realm=\"testrealm@host.com\","
- " qop=\"auth,auth-int\","
- " nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\","
- " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"";
-const char * const DIGEST_METHOD = "GET";
-const char * const DIGEST_URI =
- "/dir/index.html";;
-const char * const DIGEST_CNONCE =
- "0a4f113b";
-const char * const DIGEST_RESPONSE =
- "6629fae49393a05397450978507c4ef1";
-//user_ = "Mufasa";
-//pass_ = "Circle Of Life";
-*/
-const char * const DIGEST_CHALLENGE =
- "Digest realm=\"Squid proxy-caching web server\","
- " nonce=\"Nny4QuC5PwiSDixJ\","
- " qop=\"auth\","
- " stale=false";
-const char * const DIGEST_URI =
- "/";
-const char * const DIGEST_CNONCE =
- "6501d58e9a21cee1e7b5fec894ded024";
-const char * const DIGEST_RESPONSE =
- "edffcb0829e755838b073a4a42de06bc";
-#endif
-
std::string quote(const std::string& str) {
std::string result;
result.push_back('"');
@@ -748,11 +717,6 @@ HttpAuthResult HttpAuthenticate(
const std::string& username, const CryptString& password,
HttpAuthContext *& context, std::string& response, std::string& auth_method)
{
-#if TEST_DIGEST
- challenge = DIGEST_CHALLENGE;
- len = strlen(challenge);
-#endif
-
HttpAttributeList args;
HttpParseAttributes(challenge, len, args);
HttpHasNthAttribute(args, 0, &auth_method, NULL);
@@ -796,15 +760,9 @@ HttpAuthResult HttpAuthenticate(
context = new HttpAuthContext(auth_method);
std::string cnonce, ncount;
-#if TEST_DIGEST
- method = DIGEST_METHOD;
- uri = DIGEST_URI;
- cnonce = DIGEST_CNONCE;
-#else
char buffer[256];
sprintf(buffer, "%d", static_cast<int>(time(0)));
cnonce = MD5(buffer);
-#endif
ncount = "00000001";
std::string realm, nonce, qop, opaque;
@@ -837,10 +795,6 @@ HttpAuthResult HttpAuthenticate(
std::string HA2 = MD5(A2);
std::string dig_response = MD5(HA1 + ":" + middle + ":" + HA2);
-#if TEST_DIGEST
- RTC_DCHECK(strcmp(dig_response.c_str(), DIGEST_RESPONSE) == 0);
-#endif
-
std::stringstream ss;
ss << auth_method;
ss << " username=" << quote(username);
« no previous file with comments | « webrtc/base/httpclient.cc ('k') | webrtc/base/httpserver.cc » ('j') | webrtc/pc/webrtcsdp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698