p+=3;
}
- for(;xisspace(*p);++p); // skip whitespace
+ for (; xisspace(*p); ++p); // skip whitespace
}
const mb_size_t blobSize = (buf+len-p);
operator <<(std::ostream &os, const HelperReply &r)
{
os << "{result=";
- switch(r.result)
- {
+ switch (r.result) {
case HelperReply::Okay:
os << "OK";
break;
assert(replyData->auth_user_request != NULL);
Auth::UserRequest::Pointer auth_user_request = replyData->auth_user_request;
- switch(reply.result)
- {
- case HelperReply::Error:
- {
+ switch (reply.result) {
+ case HelperReply::Error: {
/* allow this because the digest_request pointer is purely local */
Auth::Digest::UserRequest *digest_request = dynamic_cast<Auth::Digest::UserRequest *>(auth_user_request.getRaw());
assert(digest_request);
if (reply.other().hasContent())
digest_request->setDenyMessage(reply.other().content());
}
- break;
+ break;
case HelperReply::Unknown: // Squid 3.2 and older the digest helper only returns a HA1 hash (no "OK")
- case HelperReply::Okay:
- {
+ case HelperReply::Okay: {
/* allow this because the digest_request pointer is purely local */
Auth::Digest::User *digest_user = dynamic_cast<Auth::Digest::User *>(auth_user_request->user().getRaw());
assert(digest_user != NULL);
CvtBin(reply.other().content(), digest_user->HA1);
digest_user->HA1created = 1;
}
- break;
+ break;
default:
; // XXX: handle other states properly.
}
const char *blob = modifiableBlob;
- switch(reply.result)
- {
+ switch (reply.result) {
case HelperReply::TT:
/* we have been given a blob to send to the client */
safe_free(lm_request->server_blob);
break;
case HelperReply::AF:
- case HelperReply::Okay:
- {
+ case HelperReply::Okay: {
if (arg == NULL) {
// XXX: handle a success with no username better
/* protocol error */
auth_user_request->user()->credentials(Auth::Ok);
debugs(29, 4, HERE << "Successfully validated user via Negotiate. Username '" << arg << "'");
}
- break;
+ break;
case HelperReply::NA:
case HelperReply::Error:
/* seperate out the useful data */
const char *blob = reply.other().content();
- switch(reply.result)
- {
+ switch (reply.result) {
case HelperReply::TT:
/* we have been given a blob to send to the client */
safe_free(lm_request->server_blob);
break;
case HelperReply::AF:
- case HelperReply::Okay:
- {
+ case HelperReply::Okay: {
/* we're finished, release the helper */
auth_user_request->user()->username(blob);
auth_user_request->denyMessage("Login successful");
auth_user_request->user()->credentials(Auth::Ok);
debugs(29, 4, HERE << "Successfully validated user via NTLM. Username '" << blob << "'");
}
- break;
+ break;
case HelperReply::NA:
case HelperReply::Error:
* Build with -DLOCKCOUNT_DEBUG flag to enable lock debugging.
* It is disabled by default due to the cost of debug output.
*/
-class Lock {
+class Lock
+{
public:
Lock():count_(0) {}
if (const char *t = strchr(res, ' ')) {
static int warn = 0;
debugs(61, (!(warn++%50)? DBG_CRITICAL:2), "UPGRADE WARNING: URL rewriter reponded with garbage '" << t <<
- "'. Future Squid will treat this as part of the URL.");
+ "'. Future Squid will treat this as part of the URL.");
const mb_size_t garbageLength = reply.other().contentSize() - (t-res);
reply.modifiableOther().truncate(garbageLength);
}